-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
844a8f8
commit 0f4154b
Showing
5 changed files
with
52 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package de.jplag.cli; | ||
|
||
import de.jplag.JPlagResult; | ||
import de.jplag.csv.comparisons.CsvComparisonOutput; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
|
||
public class OutputFileGenerator { | ||
private static final Logger LOGGER = LoggerFactory.getLogger(OutputFileGenerator.class); | ||
|
||
/** | ||
* Exports the given result as csvs, if the csvExport is activated in the options. | ||
* Both a full and an anonymized version will be written. | ||
* | ||
* @param result The result to export | ||
* @param outputRoot The root folder for the output | ||
* @param options The cli options | ||
*/ | ||
public static void generateCsvOutput(JPlagResult result, File outputRoot, CliOptions options) { | ||
if (options.advanced.csvExport) { | ||
try { | ||
CsvComparisonOutput.writeCsvResults(result.getAllComparisons(), false, outputRoot, "results"); | ||
CsvComparisonOutput.writeCsvResults(result.getAllComparisons(), true, outputRoot, "results-anonymous"); | ||
} catch (IOException e) { | ||
LOGGER.warn("Could not write csv results", e); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters