Class HttpsFileSystem

All Implemented Interfaces:
Closeable, AutoCloseable, Configurable, BulkDeleteSource, PathCapabilities, DelegationTokenIssuer

public class HttpsFileSystem extends FileSystem
A Filesystem that reads from HTTPS endpoint.
  • Constructor Details

    • HttpsFileSystem

      public HttpsFileSystem()
  • Method Details

    • getScheme

      public String getScheme()
      Description copied from class: FileSystem
      Return the protocol scheme for this FileSystem.

      This implementation throws an UnsupportedOperationException.

      Returns:
      the protocol scheme for this FileSystem.
    • initialize

      public void initialize(URI name, Configuration conf) throws IOException
      Description copied from class: FileSystem
      Initialize a FileSystem. Called after the new FileSystem instance is constructed, and before it is ready for use. FileSystem implementations overriding this method MUST forward it to their superclass, though the order in which it is done, and whether to alter the configuration before the invocation are options of the subclass.
      Overrides:
      initialize in class FileSystem
      Parameters:
      name - a URI whose authority section names the host, port, etc. for this FileSystem
      conf - the configuration
      Throws:
      IOException - on any failure to initialize this instance.
    • getUri

      public URI getUri()
      Description copied from class: FileSystem
      Returns a URI which identifies this FileSystem.
      Specified by:
      getUri in class FileSystem
      Returns:
      the URI of this filesystem.
    • open

      public FSDataInputStream open(Path path, int bufferSize) throws IOException
      Description copied from class: FileSystem
      Opens an FSDataInputStream at the indicated Path.
      Specified by:
      open in class FileSystem
      Parameters:
      path - the file name to open
      bufferSize - the size of the buffer to be used.
      Returns:
      input stream.
      Throws:
      IOException - IO failure
    • create

      public FSDataOutputStream create(Path path, FsPermission fsPermission, boolean b, int i, short i1, long l, Progressable progressable) throws IOException
      Description copied from class: FileSystem
      Create an FSDataOutputStream at the indicated Path with write-progress reporting.
      Specified by:
      create in class FileSystem
      Parameters:
      path - the file name to open
      fsPermission - file permission
      b - if a file with this name already exists, then if true, the file will be overwritten, and if false an error will be thrown.
      i - the size of the buffer to be used.
      i1 - required block replication for the file.
      l - block size
      progressable - the progress reporter
      Returns:
      output stream.
      Throws:
      IOException - IO failure
      See Also:
    • append

      public FSDataOutputStream append(Path path, int i, Progressable progressable) throws IOException
      Description copied from class: FileSystem
      Append to an existing file (optional operation).
      Specified by:
      append in class FileSystem
      Parameters:
      path - the existing file to be appended.
      i - the size of the buffer to be used.
      progressable - for reporting progress if it is not null.
      Returns:
      output stream.
      Throws:
      IOException - IO failure
    • rename

      public boolean rename(Path path, Path path1) throws IOException
      Description copied from class: FileSystem
      Renames Path src to Path dst.
      Specified by:
      rename in class FileSystem
      Parameters:
      path - path to be renamed
      path1 - new path after rename
      Returns:
      true if rename is successful
      Throws:
      IOException - on failure
    • delete

      public boolean delete(Path path, boolean b) throws IOException
      Description copied from class: FileSystem
      Delete a file.
      Specified by:
      delete in class FileSystem
      Parameters:
      path - the path to delete.
      b - if path is a directory and set to true, the directory is deleted else throws an exception. In case of a file the recursive can be set to either true or false.
      Returns:
      true if delete is successful else false.
      Throws:
      IOException - IO failure
    • listStatus

      public FileStatus[] listStatus(Path path) throws IOException
      Description copied from class: FileSystem
      List the statuses of the files/directories in the given path if the path is a directory.

      Does not guarantee to return the List of files/directories status in a sorted order.

      Will not return null. Expect IOException upon access error.

      Specified by:
      listStatus in class FileSystem
      Parameters:
      path - given path
      Returns:
      the statuses of the files/directories in the given patch
      Throws:
      FileNotFoundException - when the path does not exist
      IOException - see specific implementation
    • setWorkingDirectory

      public void setWorkingDirectory(Path path)
      Description copied from class: FileSystem
      Set the current working directory for the given FileSystem. All relative paths will be resolved relative to it.
      Specified by:
      setWorkingDirectory in class FileSystem
      Parameters:
      path - Path of new working directory
    • getWorkingDirectory

      public Path getWorkingDirectory()
      Description copied from class: FileSystem
      Get the current working directory for the given FileSystem
      Specified by:
      getWorkingDirectory in class FileSystem
      Returns:
      the directory pathname
    • mkdirs

      public boolean mkdirs(Path path, FsPermission fsPermission) throws IOException
      Description copied from class: FileSystem
      Make the given file and all non-existent parents into directories. Has roughly the semantics of Unix @{code mkdir -p}. Existence of the directory hierarchy is not an error.
      Specified by:
      mkdirs in class FileSystem
      Parameters:
      path - path to create
      fsPermission - to apply to f
      Returns:
      if mkdir success true, not false.
      Throws:
      IOException - IO failure
    • getFileStatus

      public FileStatus getFileStatus(Path path) throws IOException
      Description copied from class: FileSystem
      Return a file status object that represents the path.
      Specified by:
      getFileStatus in class FileSystem
      Parameters:
      path - The path we want information from
      Returns:
      a FileStatus object
      Throws:
      FileNotFoundException - when the path does not exist
      IOException - see specific implementation
    • hasPathCapability

      public boolean hasPathCapability(Path path, String capability) throws IOException
      Declare that this filesystem connector is always read only. The base FileSystem implementation generally has no knowledge of the capabilities of actual implementations. Unless it has a way to explicitly determine the capabilities, this method returns false. Probe for a specific capability under the given path. If the function returns true, this instance is explicitly declaring that the capability is available. If the function returns false, it can mean one of:
      • The capability is not known.
      • The capability is known but it is not supported.
      • The capability is known but the filesystem does not know if it is supported under the supplied path.
      The core guarantee which a caller can rely on is: if the predicate returns true, then the specific operation/behavior can be expected to be supported. However a specific call may be rejected for permission reasons, the actual file/directory not being present, or some other failure during the attempted execution of the operation.

      Implementors: PathCapabilitiesSupport can be used to help implement this method.

      Specified by:
      hasPathCapability in interface PathCapabilities
      Overrides:
      hasPathCapability in class FileSystem
      Parameters:
      path - path to query the capability of.
      capability - non-null, non-empty string to query the path for support.
      Returns:
      true if the capability is supported under that part of the FS.
      Throws:
      IOException - this should not be raised, except on problems resolving paths or relaying the call.