Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public Optional<FileStore> provideNativeFileStore(@PathToVault Path pathToVault)
try {
return Optional.of(Files.getFileStore(pathToVault));
} catch (IOException e) {
LOG.warn("Failed to get file store for " + pathToVault, e);
LOG.warn("Failed to get file store for {}", pathToVault, e);
return Optional.empty();
}
}
Expand All @@ -52,7 +52,7 @@ public Consumer<FilesystemEvent> provideFilesystemEventConsumer(CryptoFileSystem
try {
eventConsumer.accept(event);
} catch (RuntimeException e) {
LOG.warn("Filesystem event consumer failed with exception when processing event {}", event, e);
LOG.warn("Filesystem event consumer failed with exception when processing event {}", event.getClass().getSimpleName(), e);
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private String readVaultConfigFile(Path pathToVault, CryptoFileSystemProperties
// TODO: remove this check and tell downstream users to check the vault dir structure before creating a CryptoFileSystemImpl
@SuppressWarnings("deprecation") var masterkeyFilename = properties.masterkeyFilename();
if (masterkeyFilename != null && Files.exists(pathToVault.resolve(masterkeyFilename))) {
LOG.warn("Failed to read {}, but found {}}", vaultConfigFile, masterkeyFilename);
LOG.warn("Failed to read {}, but found {}", vaultConfigFile, masterkeyFilename);
throw new FileSystemNeedsMigrationException(pathToVault);
} else {
throw e;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public CiphertextFileType getCiphertextFileType(CryptoPath cleartextPath) throws
return CiphertextFileType.FILE;
} else {
eventConsumer.accept(new BrokenFileNodeEvent(cleartextPath, ciphertextPath.getRawPath()));
LOG.warn("Did not find valid content inside of {}", ciphertextPath.getRawPath());
LOG.warn("Ciphertext directory {} has no clear type. Missing id files for dir, symlink or shortened file.", ciphertextPath.getRawPath());
throw new InvalidFileNodeException(cleartextPath.toString(), ciphertextPath.getRawPath().toString());
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static Path attemptBackup(Path path) throws IOException {
} catch (AccessDeniedException | FileAlreadyExistsException e) {
assertSameContent(backupFilePath, path);
} catch (IOException e) {
LOG.warn("Failed to backup valid {} file.", fileToBackup);
LOG.warn("Failed to backup {}.", fileToBackup);
}
return backupFilePath;
}
Expand All @@ -71,7 +71,7 @@ private static void assertSameContent(final Path backupFile, final Path original
LOG.warn("Corrupt {} backup for: {}. Please replace it manually or unlock the vault on a writable storage device.", backupFile.getFileName(), backupFile);
}
} catch (IOException e) {
LOG.warn("Failed to compare valid %s with backup file.".formatted(backupFile), e);
LOG.warn("Failed to compare backup {} to original {} .", backupFile, originalFile, e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ public Stream<Node> process(Node node) {
try {
dirPath = cryptoPathMapper.resolveDirectory(dirFile).path();
} catch (IOException e) {
LOG.warn("Broken directory file: " + dirFile, e);
LOG.warn("Broken directory: Exception reading dir file {}.", dirFile, e);
return Stream.empty();
}
if (!Files.isDirectory(dirPath)) {
LOG.warn("Broken directory file {}. Directory {} does not exist.", dirFile, dirPath);
LOG.warn("Broken directory: Dir file {} points to non existing content directory {}.", dirFile, dirPath);
return Stream.empty();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public Stream<Node> process(Node node) {
return resolveConflict(node, canonicalPath);
} catch (IOException e) {
eventConsumer.accept(new ConflictResolutionFailedEvent(cleartextPath.resolve(node.cleartextName), node.ciphertextPath, e));
LOG.error("Failed to resolve conflict for {}", node.ciphertextPath, e);
LOG.warn("Failed to resolve conflict for {}", node.ciphertextPath, e);
return Stream.empty();
}
}
Expand Down Expand Up @@ -133,7 +133,7 @@ private Stream<Node> renameConflictingFile(Path canonicalPath, Node conflicting)

assert alternativeCiphertextName.length() <= maxC9rFileNameLength;
if (Files.exists(alternativePath)) {
LOG.warn("Failed finding alternative name for {}. Keeping original name.", conflicting.ciphertextPath);
LOG.warn("Failed finding alternative name for {}: Alternative name {} already exists. Keeping original name.", conflicting.ciphertextPath, alternativePath);
return Stream.empty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,23 +111,23 @@ private FileVisitResult visitDirFile(Path dirFile, BasicFileAttributes attrs) th
var parentDirName = dirFile.getParent().getFileName().toString();

if (!(parentDirName.endsWith(Constants.CRYPTOMATOR_FILE_SUFFIX) || parentDirName.endsWith(Constants.DEFLATED_FILE_SUFFIX))) {
LOG.warn("Encountered loose dir.c9r file.");
LOG.debug("Encountered loose dir.c9r file.");
resultCollector.accept(new LooseDirFile(dirFile));
return FileVisitResult.CONTINUE;
}

if (attrs.size() > Constants.MAX_DIR_ID_LENGTH) {
LOG.warn("Encountered dir.c9r file of size {}", attrs.size());
LOG.debug("Encountered obese dir.c9r file of size {}", attrs.size());
resultCollector.accept(new ObeseDirFile(dirFile, attrs.size()));
} else if (attrs.size() == 0) {
LOG.warn("Empty dir.c9r file at {}.", dirFile);
LOG.debug("Encountered empty dir.c9r file at {}.", dirFile);
resultCollector.accept(new EmptyDirFile(dirFile));
} else {
byte[] bytes = Files.readAllBytes(dirFile);
String dirId = new String(bytes, StandardCharsets.UTF_8);
if (dirIds.containsKey(dirId)) {
var otherFile = dirIds.get(dirId);
LOG.warn("Same directory ID used by {} and {}", dirFile, otherFile);
LOG.debug("Encountered same directory ID twice: Used by {} and {}.", dirFile, otherFile);
resultCollector.accept(new DirIdCollision(dirId, dirFile, otherFile));
} else {
dirIds.put(dirId, dirFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private void runRefresh(int count) {
CONCURRENT_WRITES_SEMAPHORE.release();
}
} catch (InterruptedException e) {
LOG.debug("Interrupt during refresh of {}. Closing token.", filePath);
LOG.warn("Interrupt during refresh of {}. Closing token.", filePath);
close();
Thread.currentThread().interrupt();
throw new RuntimeException(e); //mark the completion stage as failed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOEx
Path migratedFile = migration.migrate();
LOG.info("MOVED {} to {}", migration.getOldPath(), migratedFile);
} catch (FileAlreadyExistsException e) {
LOG.warn("Failed to migrate " + migration.getOldPath() + " due to FileAlreadyExistsException. This can be caused either by sync conflicts or because this file has already been migrated on a different machine.", e);
LOG.warn("Failed to migrate {} due to FileAlreadyExistsException. This can be caused either by sync conflicts or because this file has already been migrated on a different machine.", migration.getOldPath(), e);
}
}
migrationsInCurrentDir.clear();
Expand Down