@Service public class FileUtilService extends Object
| Modifier and Type | Field and Description |
|---|---|
private static char |
DOT |
private static org.slf4j.Logger |
logger |
private static String |
REPORT_FOLDER_EXTENSION |
| Constructor and Description |
|---|
FileUtilService() |
| Modifier and Type | Method and Description |
|---|---|
private void |
addFileToMap(List<com.credibledoc.combiner.node.applicationlog.ApplicationLog> applicationLogs,
Map<com.credibledoc.combiner.application.Application,Map<Date,File>> map,
File[] files,
File file) |
private void |
collectApplicationLogs(File directory,
List<com.credibledoc.combiner.node.applicationlog.ApplicationLog> applicationLogs)
Sort files in a directory from the first argument.
|
File |
generateFile(Integer fileNumber,
String fileName,
File reportDirectory,
String fileExtension)
Generate a new file with transformed content of source log files.
|
private File |
unzipIfNotExists(File zipFile,
File[] files)
If the second argument contains unzipped first argument, do not unzip it.
|
private static final org.slf4j.Logger logger
private static final char DOT
private static final String REPORT_FOLDER_EXTENSION
@Inject public FileUtilService()
public File generateFile(Integer fileNumber, String fileName, File reportDirectory, String fileExtension)
fileNumber - an order number. Can be 'null' if a single file
should be created in the directory. If not 'null',
this number will be appended to the file name,
for example index_001.htmlfileName - the file name without extensionreportDirectory - where the new file will be createdfileExtension - for example html or txtprivate void collectApplicationLogs(File directory, List<com.credibledoc.combiner.node.applicationlog.ApplicationLog> applicationLogs)
Application creates its own list of files.directory - cannot be 'null'. Can have files from different Applications.applicationLogs - at first invocation an empty, and it will be filled with filesprivate void addFileToMap(List<com.credibledoc.combiner.node.applicationlog.ApplicationLog> applicationLogs, Map<com.credibledoc.combiner.application.Application,Map<Date,File>> map, File[] files, File file)
private File unzipIfNotExists(File zipFile, File[] files)
zipFile - zipped log filefiles - all files in a directoryCopyright © 2019. All rights reserved.