Class S3FileSystemProvider


  • public class S3FileSystemProvider
    extends java.nio.file.spi.FileSystemProvider
    Service-provider class for S3 when represented as an NIO filesystem. The methods defined by the Files class will delegate to an instance of this class when referring to an object in S3. This class will in turn make calls to the S3 service.
    This class should never be used directly. It is invoked by the service loader when, for example, the java.nio.file.Files class is used to address an object beginning with the scheme "s3".
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String SCHEME
      Constant for the S3 scheme "s3"
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void checkAccess​(java.nio.file.Path path, java.nio.file.AccessMode... modes)
      Checks the existence, and optionally the accessibility, of a file.
      protected void checkAccess​(software.amazon.awssdk.services.s3.S3AsyncClient s3Client, java.nio.file.Path path, java.nio.file.AccessMode... modes)
      Composable and testable version of checkAccess that uses the provided client to check access
      void copy​(java.nio.file.Path source, java.nio.file.Path target, java.nio.file.CopyOption... options)
      Copy a file to a target file.
      protected void copy​(software.amazon.awssdk.services.s3.S3AsyncClient s3Client, java.nio.file.Path source, java.nio.file.Path target, java.nio.file.CopyOption... options)  
      void createDirectory​(java.nio.file.Path dir, java.nio.file.attribute.FileAttribute<?>... attrs)
      Creates a new directory.
      protected void createDirectory​(software.amazon.awssdk.services.s3.S3AsyncClient s3Client, java.nio.file.Path dir, java.nio.file.attribute.FileAttribute<?>... attrs)  
      void delete​(java.nio.file.Path path)
      Deletes a file.
      protected void delete​(software.amazon.awssdk.services.s3.S3AsyncClient s3Client, java.nio.file.Path path)  
      protected boolean exists​(software.amazon.awssdk.services.s3.S3AsyncClient s3Client, S3Path path)  
      <V extends java.nio.file.attribute.FileAttributeView>
      V
      getFileAttributeView​(java.nio.file.Path path, java.lang.Class<V> type, java.nio.file.LinkOption... options)
      Returns a file attribute view of a given type.
      java.nio.file.FileStore getFileStore​(java.nio.file.Path path)
      S3 buckets don't have partitions or volumes so there are no file stores
      S3FileSystem getFileSystem​(java.net.URI uri)
      Returns an existing FileSystem created by this provider.
      S3Path getPath​(java.net.URI uri)
      Return a Path object by converting the given URI.
      java.lang.String getScheme()
      Returns the URI scheme that identifies this provider.
      boolean isHidden​(java.nio.file.Path path)
      There are no hidden files in S3
      boolean isSameFile​(java.nio.file.Path path, java.nio.file.Path path2)
      Tests if two paths locate the same file.
      void move​(java.nio.file.Path source, java.nio.file.Path target, java.nio.file.CopyOption... options)
      Move or rename a file to a target file.
      protected void move​(software.amazon.awssdk.services.s3.S3AsyncClient s3AsyncClient, java.nio.file.Path source, java.nio.file.Path target, java.nio.file.CopyOption... options)  
      java.nio.channels.SeekableByteChannel newByteChannel​(java.nio.file.Path path, java.util.Set<? extends java.nio.file.OpenOption> options, java.nio.file.attribute.FileAttribute<?>... attrs)
      Opens or creates a file, returning a seekable byte channel to access the file.
      protected java.nio.channels.SeekableByteChannel newByteChannel​(software.amazon.awssdk.services.s3.S3AsyncClient client, java.nio.file.Path path, java.util.Set<? extends java.nio.file.OpenOption> options, java.nio.file.attribute.FileAttribute<?>... attrs)
      Construct a byte channel for the path with the specified client.
      java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream​(java.nio.file.Path dir, java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter)
      Opens a directory, returning a DirectoryStream to iterate over the entries in the directory.
      protected java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream​(software.amazon.awssdk.services.s3.S3AsyncClient s3Client, java.nio.file.Path dir, java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter)
      Get a new directory stream that will use the specified client.
      java.nio.file.FileSystem newFileSystem​(java.net.URI uri, java.util.Map<java.lang.String,​?> env)
      Constructs a new FileSystem object identified by a URI.
      protected java.util.Iterator<java.nio.file.Path> pathIteratorForPublisher​(java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter, java.nio.file.FileSystem fs, java.lang.String finalDirName, software.amazon.awssdk.services.s3.paginators.ListObjectsV2Publisher listObjectsV2Publisher)
      Get an iterator for a ListObjectsV2Publisher.
      <A extends java.nio.file.attribute.BasicFileAttributes>
      A
      readAttributes​(java.nio.file.Path path, java.lang.Class<A> type, java.nio.file.LinkOption... options)
      Reads a file's attributes as a bulk operation.
      java.util.Map<java.lang.String,​java.lang.Object> readAttributes​(java.nio.file.Path path, java.lang.String attributes, java.nio.file.LinkOption... options)
      Reads a set of file attributes as a bulk operation.
      protected <A extends java.nio.file.attribute.BasicFileAttributes>
      A
      readAttributes​(software.amazon.awssdk.services.s3.S3AsyncClient s3AsyncClient, java.nio.file.Path path, java.lang.Class<A> type, java.nio.file.LinkOption... options)  
      protected java.util.Map<java.lang.String,​java.lang.Object> readAttributes​(software.amazon.awssdk.services.s3.S3AsyncClient client, java.nio.file.Path path, java.lang.String attributes, java.nio.file.LinkOption... options)  
      void setAttribute​(java.nio.file.Path path, java.lang.String attribute, java.lang.Object value, java.nio.file.LinkOption... options)
      File attributes of S3 objects cannot be set other than by creating a new object
      • Methods inherited from class java.nio.file.spi.FileSystemProvider

        createLink, createSymbolicLink, deleteIfExists, installedProviders, newAsynchronousFileChannel, newFileChannel, newFileSystem, newInputStream, newOutputStream, readSymbolicLink
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • SCHEME

        public static final java.lang.String SCHEME
        Constant for the S3 scheme "s3"
        See Also:
        Constant Field Values
    • Constructor Detail

      • S3FileSystemProvider

        public S3FileSystemProvider()
    • Method Detail

      • getScheme

        public java.lang.String getScheme()
        Returns the URI scheme that identifies this provider.
        Specified by:
        getScheme in class java.nio.file.spi.FileSystemProvider
        Returns:
        The URI scheme (s3)
      • newFileSystem

        public java.nio.file.FileSystem newFileSystem​(java.net.URI uri,
                                                      java.util.Map<java.lang.String,​?> env)
        Constructs a new FileSystem object identified by a URI. This method is invoked by the FileSystems.newFileSystem(URI, Map) method to open a new file system identified by a URI.

        The uri parameter is an absolute, hierarchical URI, with a scheme equal (without regard to case) to the scheme supported by this provider. The exact form of the URI is highly provider dependent. The env parameter is a map of provider specific properties to configure the file system.

        This method throws FileSystemAlreadyExistsException if the file system already exists because it was previously created by an invocation of this method. Once a file system is closed it is provider-dependent if the provider allows a new file system to be created with the same URI as a file system it previously created.

        Specified by:
        newFileSystem in class java.nio.file.spi.FileSystemProvider
        Parameters:
        uri - URI reference
        env - A map of provider specific properties to configure the file system; may be empty
        Returns:
        A new file system
      • getFileSystem

        public S3FileSystem getFileSystem​(java.net.URI uri)
        Returns an existing FileSystem created by this provider.

        This method returns a reference to a FileSystem that was created by invoking the newFileSystem(URI,Map) method. File systems created the newFileSystem(Path,Map) method are not returned by this method. The file system is identified by its URI. Its exact form is highly provider dependent. In the case of the default provider the URI's path component is "/" and the authority, query and fragment components are undefined (Undefined components are represented by null).

        Once a file system created by this provider is closed it is provider-dependent if this method returns a reference to the closed file system or throws FileSystemNotFoundException. If the provider allows a new file system to be created with the same URI as a file system it previously created then this method throws the exception if invoked after the file system is closed (and before a new instance is created by the newFileSystem method).

        If a security manager is installed then a provider implementation may require to check a permission before returning a reference to an existing file system. In the case of the default file system, no permission check is required.

        Specified by:
        getFileSystem in class java.nio.file.spi.FileSystemProvider
        Parameters:
        uri - URI reference
        Returns:
        The file system
        Throws:
        java.lang.IllegalArgumentException - If the pre-conditions for the uri parameter aren't met
        java.nio.file.FileSystemNotFoundException - If the file system does not exist
        java.lang.SecurityException - If a security manager is installed, and it denies an unspecified permission.
      • getPath

        public S3Path getPath​(java.net.URI uri)
        Return a Path object by converting the given URI. The resulting Path is associated with a FileSystem that already exists or is constructed automatically.

        The exact form of the URI is file system provider dependent. In the case of the default provider, the URI scheme is "file" and the given URI has a non-empty path component, and undefined query, and fragment components. The resulting Path is associated with the default default FileSystem.

        If a security manager is installed then a provider implementation may require to check a permission. In the case of the default file system, no permission check is required.

        Specified by:
        getPath in class java.nio.file.spi.FileSystemProvider
        Parameters:
        uri - The URI to convert. Must not be null.
        Returns:
        The resulting Path
        Throws:
        java.lang.IllegalArgumentException - If the URI scheme does not identify this provider or other preconditions on the uri parameter do not hold
        java.nio.file.FileSystemNotFoundException - The file system, identified by the URI, does not exist and cannot be created automatically
        java.lang.SecurityException - If a security manager is installed, and it denies an unspecified permission.
      • newByteChannel

        public java.nio.channels.SeekableByteChannel newByteChannel​(java.nio.file.Path path,
                                                                    java.util.Set<? extends java.nio.file.OpenOption> options,
                                                                    java.nio.file.attribute.FileAttribute<?>... attrs)
                                                             throws java.io.IOException
        Opens or creates a file, returning a seekable byte channel to access the file. This method works in exactly the manner specified by the Files.newByteChannel(Path, Set, FileAttribute[]) method.
        Specified by:
        newByteChannel in class java.nio.file.spi.FileSystemProvider
        Parameters:
        path - the path to the file to open or create
        options - options specifying how the file is opened
        attrs - an optional list of file attributes to set atomically when creating the file
        Returns:
        a new seekable byte channel
        Throws:
        java.lang.IllegalArgumentException - if the set contains an invalid combination of options
        java.lang.UnsupportedOperationException - if an unsupported open option is specified or the array contains attributes that cannot be set atomically when creating the file
        java.nio.file.FileAlreadyExistsException - if a file of that name already exists and the CREATE_NEW option is specified (optional specific exception)
        java.io.IOException - if an I/O error occurs
        java.lang.SecurityException - In the case of the default provider, and a security manager is installed, the checkRead method is invoked to check read access to the path if the file is opened for reading. The checkWrite method is invoked to check write access to the path if the file is opened for writing. The checkDelete method is invoked to check delete access if the file is opened with the DELETE_ON_CLOSE option.
      • newByteChannel

        protected java.nio.channels.SeekableByteChannel newByteChannel​(software.amazon.awssdk.services.s3.S3AsyncClient client,
                                                                       java.nio.file.Path path,
                                                                       java.util.Set<? extends java.nio.file.OpenOption> options,
                                                                       java.nio.file.attribute.FileAttribute<?>... attrs)
                                                                throws java.io.IOException
        Construct a byte channel for the path with the specified client. A more composable and testable (by using a Mock Client) version of the public method
        Parameters:
        client - The client to use for the channel
        path - The path to open
        options - The options to use
        attrs - The attributes to use
        Returns:
        A new byte channel for the object at path
        Throws:
        java.io.IOException - If the channel could not be created
      • newDirectoryStream

        public java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream​(java.nio.file.Path dir,
                                                                                    java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter)
                                                                             throws java.io.IOException
        Opens a directory, returning a DirectoryStream to iterate over the entries in the directory. This method works in exactly the manner specified by the Files.newDirectoryStream(Path, DirectoryStream.Filter) method.
        Specified by:
        newDirectoryStream in class java.nio.file.spi.FileSystemProvider
        Parameters:
        dir - the path to the directory
        filter - the directory stream filter
        Returns:
        a new and open DirectoryStream object
        Throws:
        java.io.IOException
      • newDirectoryStream

        protected java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream​(software.amazon.awssdk.services.s3.S3AsyncClient s3Client,
                                                                                       java.nio.file.Path dir,
                                                                                       java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter)
                                                                                throws java.util.concurrent.ExecutionException,
                                                                                       java.lang.InterruptedException
        Get a new directory stream that will use the specified client. A composable and testable version of the public version of newDirectoryStream
        Parameters:
        s3Client - The client to use for the directory stream
        dir - the directory to stream
        filter - the filter to apply to paths returned from the stream. Paths that are not accepted by the filter are not returned.
        Returns:
        a stream for the directory. The stream may not be null but may be empty.
        Throws:
        java.util.concurrent.ExecutionException - if the client async call(s) are interrupted or time out.
        java.lang.InterruptedException - if the client async call(s) are interrupted or time out.
      • pathIteratorForPublisher

        protected java.util.Iterator<java.nio.file.Path> pathIteratorForPublisher​(java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter,
                                                                                  java.nio.file.FileSystem fs,
                                                                                  java.lang.String finalDirName,
                                                                                  software.amazon.awssdk.services.s3.paginators.ListObjectsV2Publisher listObjectsV2Publisher)
        Get an iterator for a ListObjectsV2Publisher. This method is protected level access only for testing purposes. It is not intended to be used by any other code outside of this class.
        Parameters:
        filter - a filter to apply to returned Paths. Only accepted paths will be included.
        fs - the Filesystem.
        finalDirName - the directory name that will be streamed.
        listObjectsV2Publisher - the publisher that returns objects and common prefixes that are iterated on.
        Returns:
        an iterator for Paths constructed from the ListObjectsV2Publishers responses.
      • createDirectory

        public void createDirectory​(java.nio.file.Path dir,
                                    java.nio.file.attribute.FileAttribute<?>... attrs)
                             throws java.io.IOException
        Creates a new directory. This method works in exactly the manner specified by the Files.createDirectory(java.nio.file.Path, java.nio.file.attribute.FileAttribute<?>...) method.
        Specified by:
        createDirectory in class java.nio.file.spi.FileSystemProvider
        Parameters:
        dir - the directory to create
        attrs - an optional list of file attributes to set atomically when creating the directory
        Throws:
        java.io.IOException
      • createDirectory

        protected void createDirectory​(software.amazon.awssdk.services.s3.S3AsyncClient s3Client,
                                       java.nio.file.Path dir,
                                       java.nio.file.attribute.FileAttribute<?>... attrs)
                                throws java.util.concurrent.ExecutionException,
                                       java.lang.InterruptedException
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • delete

        public void delete​(java.nio.file.Path path)
                    throws java.io.IOException
        Deletes a file. This method works in exactly the manner specified by the Files.delete(java.nio.file.Path) method.
        Specified by:
        delete in class java.nio.file.spi.FileSystemProvider
        Parameters:
        path - the path to the file to delete
        Throws:
        java.io.IOException
      • delete

        protected void delete​(software.amazon.awssdk.services.s3.S3AsyncClient s3Client,
                              java.nio.file.Path path)
                       throws java.util.concurrent.ExecutionException,
                              java.lang.InterruptedException
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • copy

        public void copy​(java.nio.file.Path source,
                         java.nio.file.Path target,
                         java.nio.file.CopyOption... options)
                  throws java.io.IOException
        Copy a file to a target file. This method works in exactly the manner specified by the Files.copy(Path, Path, CopyOption[]) method except that both the source and target paths must be associated with this provider.
        Specified by:
        copy in class java.nio.file.spi.FileSystemProvider
        Parameters:
        source - the path to the file to copy
        target - the path to the target file
        options - options specifying how the copy should be done
        Throws:
        java.io.IOException
      • copy

        protected void copy​(software.amazon.awssdk.services.s3.S3AsyncClient s3Client,
                            java.nio.file.Path source,
                            java.nio.file.Path target,
                            java.nio.file.CopyOption... options)
                     throws java.util.concurrent.ExecutionException,
                            java.lang.InterruptedException,
                            java.nio.file.FileAlreadyExistsException
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
        java.nio.file.FileAlreadyExistsException
      • exists

        protected boolean exists​(software.amazon.awssdk.services.s3.S3AsyncClient s3Client,
                                 S3Path path)
                          throws java.lang.InterruptedException,
                                 java.util.concurrent.TimeoutException
        Throws:
        java.lang.InterruptedException
        java.util.concurrent.TimeoutException
      • move

        public void move​(java.nio.file.Path source,
                         java.nio.file.Path target,
                         java.nio.file.CopyOption... options)
                  throws java.io.IOException
        Move or rename a file to a target file. This method works in exactly the manner specified by the Files.move(java.nio.file.Path, java.nio.file.Path, java.nio.file.CopyOption...) method except that both the source and target paths must be associated with this provider.
        Specified by:
        move in class java.nio.file.spi.FileSystemProvider
        Parameters:
        source - the path to the file to move
        target - the path to the target file
        options - options specifying how the move should be done
        Throws:
        java.io.IOException
      • move

        protected void move​(software.amazon.awssdk.services.s3.S3AsyncClient s3AsyncClient,
                            java.nio.file.Path source,
                            java.nio.file.Path target,
                            java.nio.file.CopyOption... options)
                     throws java.util.concurrent.ExecutionException,
                            java.lang.InterruptedException,
                            java.nio.file.FileAlreadyExistsException
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
        java.nio.file.FileAlreadyExistsException
      • isSameFile

        public boolean isSameFile​(java.nio.file.Path path,
                                  java.nio.file.Path path2)
                           throws java.io.IOException
        Tests if two paths locate the same file. This method works in exactly the manner specified by the Files.isSameFile(java.nio.file.Path, java.nio.file.Path) method.
        Specified by:
        isSameFile in class java.nio.file.spi.FileSystemProvider
        Parameters:
        path - one path to the file
        path2 - the other path
        Returns:
        true if, and only if, the two paths locate the same file
        Throws:
        java.io.IOException - if an I/O error occurs
        java.lang.SecurityException - In the case of the default provider, and a security manager is installed, the checkRead method is invoked to check read access to both files.
      • isHidden

        public boolean isHidden​(java.nio.file.Path path)
        There are no hidden files in S3
        Specified by:
        isHidden in class java.nio.file.spi.FileSystemProvider
        Parameters:
        path - the path to the file to test
        Returns:
        false always
      • getFileStore

        public java.nio.file.FileStore getFileStore​(java.nio.file.Path path)
        S3 buckets don't have partitions or volumes so there are no file stores
        Specified by:
        getFileStore in class java.nio.file.spi.FileSystemProvider
        Parameters:
        path - the path to the file
        Returns:
        null always
      • checkAccess

        public void checkAccess​(java.nio.file.Path path,
                                java.nio.file.AccessMode... modes)
                         throws java.io.IOException
        Checks the existence, and optionally the accessibility, of a file.

        This method may be used by the isReadable, isWritable and isExecutable methods to check the accessibility of a file.

        This method checks the existence of a file and that this Java virtual machine has appropriate privileges that would allow it to access the file according to all the access modes specified in the modes parameter as follows:

        Access Modes
        Value Description
        READ Checks that the file exists and that the Java virtual machine has permission to read the file.
        WRITE Checks that the file exists and that the Java virtual machine has permission to write to the file,
        EXECUTE Checks that the file exists and that the Java virtual machine has permission to execute the file. The semantics may differ when checking access to a directory. For example, on UNIX systems, checking for EXECUTE access checks that the Java virtual machine has permission to search the directory in order to access file or subdirectories.

        If the modes parameter is of length zero, then the existence of the file is checked.

        This method follows symbolic links if the file referenced by this object is a symbolic link. Depending on the implementation, this method may require reading file permissions, access control lists, or other file attributes in order to check the effective access to the file. To determine the effective access to a file may require access to several attributes and so in some implementations this method may not be atomic with respect to other file system operations.

        Specified by:
        checkAccess in class java.nio.file.spi.FileSystemProvider
        Parameters:
        path - the path to the file to check
        modes - The access modes to check; may have zero elements
        Throws:
        java.lang.UnsupportedOperationException - an implementation is required to support checking for READ, WRITE, and EXECUTE access. This exception is specified to allow for the Access enum to be extended in future releases.
        java.nio.file.NoSuchFileException - if a file does not exist (optional specific exception)
        java.nio.file.AccessDeniedException - the requested access would be denied or the access cannot be determined because the Java virtual machine has insufficient privileges or other reasons. (optional specific exception)
        java.io.IOException - if an I/O error occurs
        java.lang.SecurityException - In the case of the default provider, and a security manager is installed, the checkRead is invoked when checking read access to the file or only the existence of the file, the checkWrite is invoked when checking write access to the file, and checkExec is invoked when checking execute access.
      • checkAccess

        protected void checkAccess​(software.amazon.awssdk.services.s3.S3AsyncClient s3Client,
                                   java.nio.file.Path path,
                                   java.nio.file.AccessMode... modes)
                            throws java.io.IOException,
                                   java.util.concurrent.ExecutionException,
                                   java.lang.InterruptedException
        Composable and testable version of checkAccess that uses the provided client to check access
        Parameters:
        s3Client - the client to use to check access or null to use the default client
        path - the path to the file to check
        modes - the access modes to check; may have zero elements. Currently, ignored.
        Throws:
        java.io.IOException - if an I/O error occurs
        java.util.concurrent.ExecutionException - if an execution error occurs during the Async call to S3
        java.lang.InterruptedException - if the call thread it interrupted
      • getFileAttributeView

        public <V extends java.nio.file.attribute.FileAttributeView> V getFileAttributeView​(java.nio.file.Path path,
                                                                                            java.lang.Class<V> type,
                                                                                            java.nio.file.LinkOption... options)
        Returns a file attribute view of a given type. This method works in exactly the manner specified by the Files.getFileAttributeView(java.nio.file.Path, java.lang.Class<V>, java.nio.file.LinkOption...) method.
        Specified by:
        getFileAttributeView in class java.nio.file.spi.FileSystemProvider
        Parameters:
        path - the path to the file
        type - the Class object corresponding to the file attribute view. Must be BasicFileAttributeView.class or S3FileAttributeView.class
        options - ignored as there are no links in S3
        Returns:
        a file attribute view of the specified type, or null if the attribute view type is not available
      • readAttributes

        public <A extends java.nio.file.attribute.BasicFileAttributes> A readAttributes​(java.nio.file.Path path,
                                                                                        java.lang.Class<A> type,
                                                                                        java.nio.file.LinkOption... options)
        Reads a file's attributes as a bulk operation. This method works in exactly the manner specified by the Files.readAttributes(Path, Class, LinkOption[]) method.
        Specified by:
        readAttributes in class java.nio.file.spi.FileSystemProvider
        Parameters:
        path - the path to the file
        type - the Class of the file attributes required to read. Supported types are BasicFileAttributes and S3FileAttributes
        options - options indicating how symbolic links are handled
        Returns:
        the file attributes or null if path is inferred to be a directory.
      • readAttributes

        protected <A extends java.nio.file.attribute.BasicFileAttributes> A readAttributes​(software.amazon.awssdk.services.s3.S3AsyncClient s3AsyncClient,
                                                                                           java.nio.file.Path path,
                                                                                           java.lang.Class<A> type,
                                                                                           java.nio.file.LinkOption... options)
      • readAttributes

        public java.util.Map<java.lang.String,​java.lang.Object> readAttributes​(java.nio.file.Path path,
                                                                                     java.lang.String attributes,
                                                                                     java.nio.file.LinkOption... options)
        Reads a set of file attributes as a bulk operation. Largely equivalent to readAttributes(Path path, Class<A> type, LinkOption... options) where the returned object is a map of method names (attributes) to values, filtered on the comma separated attributes.
        Specified by:
        readAttributes in class java.nio.file.spi.FileSystemProvider
        Parameters:
        path - the path to the file
        attributes - the comma separated attributes to read. May be prefixed with "s3:"
        options - ignored, S3 has no links
        Returns:
        a map of the attributes returned; may be empty. The map's keys are the attribute names, its values are the attribute values. Returns an empty map if attributes is empty, or if path is inferred to be a directory.
        Throws:
        java.lang.UnsupportedOperationException - if the attribute view is not available
        java.lang.IllegalArgumentException - if no attributes are specified or an unrecognized attributes is specified
        java.lang.SecurityException - In the case of the default provider, and a security manager is installed, its checkRead method denies read access to the file. If this method is invoked to read security sensitive attributes then the security manager may be invoked to check for additional permissions.
      • readAttributes

        protected java.util.Map<java.lang.String,​java.lang.Object> readAttributes​(software.amazon.awssdk.services.s3.S3AsyncClient client,
                                                                                        java.nio.file.Path path,
                                                                                        java.lang.String attributes,
                                                                                        java.nio.file.LinkOption... options)
      • setAttribute

        public void setAttribute​(java.nio.file.Path path,
                                 java.lang.String attribute,
                                 java.lang.Object value,
                                 java.nio.file.LinkOption... options)
                          throws java.lang.UnsupportedOperationException
        File attributes of S3 objects cannot be set other than by creating a new object
        Specified by:
        setAttribute in class java.nio.file.spi.FileSystemProvider
        Throws:
        java.lang.UnsupportedOperationException - always