use of com.att.aro.ui.view.menu.profiles.ProfileException in project VideoOptimzer by attdevsupport.
the class DataDump method startDataDump.
/**
* Starts dumping data in CSV file for the provided trace files.
*
* @param traceFolders
* - List of trace folder names.
* @return A FileWriter object.
* @throws IOException
*/
private FileWriter startDataDump(List<File> traceFolders) throws IOException, ProfileException {
FileWriter writer = new FileWriter(fileToSave);
try {
List<File> validFolderList = new ArrayList<File>();
Set<AROTraceData> analysis = new LinkedHashSet<AROTraceData>();
getValidFolderList(traceFolders, validFolderList);
for (File traceDirectory : validFolderList) {
try {
analysis.add(controller.runAnalyzer(traceDirectory.getAbsolutePath(), controller.getTheModel().getAnalyzerResult().getProfile(), null));
} catch (Exception e) {
LOG.warn("Unable to run analysis on folder: " + traceDirectory, e);
}
}
try {
new ObjectMapper().writeValue(fileToSave, analysis);
} catch (JsonGenerationException e) {
LOG.error(e.getMessage());
new MessageDialogFactory().showUnexpectedExceptionDialog(MSG_WINDOW, e);
} catch (JsonMappingException e) {
LOG.error(e.getMessage());
new MessageDialogFactory().showUnexpectedExceptionDialog(MSG_WINDOW, e);
} catch (IOException e) {
LOG.error(e.getMessage());
new MessageDialogFactory().showUnexpectedExceptionDialog(MSG_WINDOW, e);
}
userPreferences.setLastTraceDirectory(traceDir);
} finally {
writer.close();
}
return writer;
}
Aggregations