-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
Description
The two write methods are defined like this:
public void writeBlob(String blobName, InputStream inputStream, long blobSize) throws IOException {
final Path file = path.resolve(blobName);
try (OutputStream outputStream = Files.newOutputStream(file)) {
...
Passing nothing to Files.newOutputStream will truncate the output file if its already there:
If no options are present then this method works as if the CREATE, TRUNCATE_EXISTING, and WRITE options are present. In other words, it opens the file for writing, creating the file if it doesn't exist, or initially truncating an existing regular-file to a size of 0 if it exists.
Can we please pass StandardOpenOptions.CREATE_NEW so that silent data truncation never happens?