From 2a567381f82f9231b619205ff39e2ec7ce2c380a Mon Sep 17 00:00:00 2001 From: Naama Gertel Date: Wed, 26 Dec 2018 19:52:02 +0200 Subject: [PATCH] make sure S3FileSystemProvider.readAttributes() sees the new file --- src/main/java/com/upplication/s3fs/S3SeekableByteChannel.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/upplication/s3fs/S3SeekableByteChannel.java b/src/main/java/com/upplication/s3fs/S3SeekableByteChannel.java index 3cb9dbf..7a00a85 100644 --- a/src/main/java/com/upplication/s3fs/S3SeekableByteChannel.java +++ b/src/main/java/com/upplication/s3fs/S3SeekableByteChannel.java @@ -52,7 +52,8 @@ else if (!exists && !this.options.contains(StandardOpenOption.CREATE_NEW) && .getObject(path.getFileStore().getBucket().getName(), key)) { Files.copy(object.getObjectContent(), tempFile, StandardCopyOption.REPLACE_EXISTING); } - } + } else + sync(); // make sure S3FileSystemProvider.readAttributes() sees the new file Set seekOptions = new HashSet<>(this.options); seekOptions.remove(StandardOpenOption.CREATE_NEW);