use of com.odysseusinc.arachne.portal.exception.ConverterRuntimeException in project ArachneCentralAPI by OHDSI.
the class AnalysisHelper method getSplittedFolder.
public Path getSplittedFolder(SubmissionGroup source) {
Path splitedFolder = getSubmissionGroupFolder(source).resolve(SPLITED_DIR);
File file = splitedFolder.toFile();
if (!file.exists()) {
if (!file.mkdirs()) {
throw new ConverterRuntimeException("Cann't create folder \"" + SPLITED_DIR + "\" ");
}
}
return splitedFolder;
}
use of com.odysseusinc.arachne.portal.exception.ConverterRuntimeException in project ArachneCentralAPI by OHDSI.
the class AnalysisHelper method getArchiveFolder.
public Path getArchiveFolder(SubmissionGroup source) {
Path archiveFolderPath = getSubmissionGroupFolder(source).resolve(ARCHIVE_DIR);
File archiveFolder = archiveFolderPath.toFile();
if (!archiveFolder.exists()) {
if (!archiveFolder.mkdirs()) {
throw new ConverterRuntimeException("can not create folder archive");
}
}
return archiveFolderPath;
}
use of com.odysseusinc.arachne.portal.exception.ConverterRuntimeException in project ArachneCentralAPI by OHDSI.
the class AnalysisHelper method compressAndSplit.
public void compressAndSplit(ArrayList<File> files, File zipArchive) {
try {
ZipFile zipFile = new ZipFile(zipArchive.getAbsoluteFile());
ZipParameters parameters = new ZipParameters();
parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE);
parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL);
zipFile.createZipFile(files, parameters, true, maximumSize);
} catch (ZipException ex) {
LOGGER.error(ex.getMessage(), ex);
throw new ConverterRuntimeException(ex.getMessage());
}
}
Aggregations