-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #535 from nestabentum/optimize_reportViewer_dto_si…
…ze_new_ready Optimize report viewer dto size new
- Loading branch information
Showing
23 changed files
with
382 additions
and
408 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
jplag/src/main/java/de/jplag/reporting/jsonfactory/FileWriter.java
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,29 @@ | ||
package de.jplag.reporting.jsonfactory; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.Path; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
||
public class FileWriter { | ||
private static final Logger logger = LoggerFactory.getLogger(FileWriter.class); | ||
|
||
private static final ObjectMapper objectMapper = new ObjectMapper(); | ||
|
||
/** | ||
* Saves the provided object to the provided path under the provided name | ||
* @param fileToSave The object to save | ||
* @param folderPath The path to save the object to | ||
* @param fileName The name to save the object under | ||
*/ | ||
public void saveAsJSON(Object fileToSave, String folderPath, String fileName) { | ||
try { | ||
objectMapper.writeValue(Path.of(folderPath, fileName).toFile(), fileToSave); | ||
} catch (IOException e) { | ||
logger.error("Failed to save json file " + fileName + ": " + e.getMessage(), e); | ||
} | ||
} | ||
} |
62 changes: 0 additions & 62 deletions
62
jplag/src/main/java/de/jplag/reporting/jsonfactory/JsonFactory.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.