Skip to content
Merged
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 @@ -176,11 +176,16 @@ public long readBlobPreferredLength() {

@Override
public void writeBlob(String blobName, InputStream inputStream, long blobSize, boolean failIfAlreadyExists) throws IOException {
if (failIfAlreadyExists == false) {
final Path file = path.resolve(blobName);
try {
writeToPath(inputStream, file, blobSize);
} catch (FileAlreadyExistsException faee) {
if (failIfAlreadyExists) {
throw faee;
}
deleteBlobsIgnoringIfNotExists(Collections.singletonList(blobName));
writeToPath(inputStream, file, blobSize);
}
final Path file = path.resolve(blobName);
writeToPath(inputStream, file, blobSize);
IOUtils.fsync(path, true);
}

Expand Down