diff --git a/src/main/java/software/amazon/nio/spi/s3/S3FileSystem.java b/src/main/java/software/amazon/nio/spi/s3/S3FileSystem.java index 1f241ca4..538f9bf4 100644 --- a/src/main/java/software/amazon/nio/spi/s3/S3FileSystem.java +++ b/src/main/java/software/amazon/nio/spi/s3/S3FileSystem.java @@ -316,6 +316,8 @@ public Iterable getFileStores() { return Collections.EMPTY_SET; } + private static final Set supportedFileAttributeViews = + Collections.singleton(BASIC_FILE_ATTRIBUTE_VIEW); /** * Returns the set of the file attribute views supported by this {@code FileSystem}. *
@@ -326,9 +328,7 @@ public Iterable getFileStores() { */ @Override public Set supportedFileAttributeViews() { - HashSet views = new HashSet<>(2); - views.add(BASIC_FILE_ATTRIBUTE_VIEW); - return Collections.unmodifiableSet(views); + return supportedFileAttributeViews; } /**