updateLatestFile(file);
}
private void addNewFileToFileStore(File file) {
try {
FileStore files = delegate.getFiles();
String path = delegate.getRootPath() + File.separator + file.getName();
if (isFileFromFileStore(file, path)) {
return;
}
FileCollisionResolver cr = FileCollisionResolver.REPLACE_EXISTING;
if (ZipUtils.isLikelyZipped(file)) {
files.addFile(file, path, cr);
} else {
byte[] compressedFile = ZipUtils.deflateFileContents(file);
files.addFile(path, compressedFile, cr);
}
} catch (IOException e) {
logStoreFileFailed(e);
} catch (FileStoreException e) {
logStoreFileFailed(e);