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..fe5853d1 100644 --- a/src/main/java/software/amazon/nio/spi/s3/S3FileSystem.java +++ b/src/main/java/software/amazon/nio/spi/s3/S3FileSystem.java @@ -15,10 +15,7 @@ import java.nio.file.*; import java.nio.file.attribute.UserPrincipalLookupService; import java.nio.file.spi.FileSystemProvider; -import java.util.Collections; -import java.util.HashSet; -import java.util.Objects; -import java.util.Set; +import java.util.*; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; import software.amazon.awssdk.services.s3.S3AsyncClient; @@ -316,6 +313,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 +325,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; } /**