org.apache.hadoop.fs.http

## Class HttpsFileSystem

- java.lang.Object
- - org.apache.hadoop.conf.Configured
  - - org.apache.hadoop.fs.FileSystem
    - - org.apache.hadoop.fs.http.HttpsFileSystem

- All Implemented Interfaces:
    Closeable, AutoCloseable, Configurable, PathCapabilities, org.apache.hadoop.security.token.DelegationTokenIssuer

      public class HttpsFileSystem
      extends FileSystem

  A Filesystem that reads from HTTPS endpoint.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.hadoop.fs.FileSystem

      `FileSystem.DirListingIterator<T extends FileStatus>, FileSystem.Statistics`

  - ### Field Summary

    - ### Fields inherited from class org.apache.hadoop.fs.FileSystem

      `DEFAULT_FS, FS_DEFAULT_NAME_KEY, SHUTDOWN_HOOK_PRIORITY, statistics, TRASH_PREFIX, USER_HOME_PREFIX`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HttpsFileSystem()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `FSDataOutputStream` | `append(Path path, int i, Progressable progressable)` Append to an existing file (optional operation).
    `FSDataOutputStream` | `create(Path path, FsPermission fsPermission, boolean b, int i, short i1, long l, Progressable progressable)` Create an FSDataOutputStream at the indicated Path with write-progress reporting.
    `boolean` | `delete(Path path, boolean b)` Delete a file.
    `FileStatus` | `getFileStatus(Path path)` Return a file status object that represents the path.
    `String` | `getScheme()` Return the protocol scheme for this FileSystem.
    `URI` | `getUri()` Returns a URI which identifies this FileSystem.
    `Path` | `getWorkingDirectory()` Get the current working directory for the given FileSystem
    `boolean` | `hasPathCapability(Path path, String capability)` Declare that this filesystem connector is always read only.
    `void` | `initialize(URI name, Configuration conf)` Initialize a FileSystem.
    `FileStatus[]` | `listStatus(Path path)` List the statuses of the files/directories in the given path if the path is a directory.
    `boolean` | `mkdirs(Path path, FsPermission fsPermission)` Make the given file and all non-existent parents into directories.
    `FSDataInputStream` | `open(Path path, int bufferSize)` Opens an FSDataInputStream at the indicated Path.
    `boolean` | `rename(Path path, Path path1)` Renames Path src to Path dst.
    `void` | `setWorkingDirectory(Path path)` Set the current working directory for the given FileSystem.

    - ### Methods inherited from class org.apache.hadoop.fs.FileSystem

      `append, append, appendFile, areSymlinksEnabled, cancelDeleteOnExit, canonicalizeUri, checkPath, clearStatistics, close, closeAll, closeAllForUGI, completeLocalOutput, concat, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyToLocalFile, copyToLocalFile, copyToLocalFile, create, create, create, create, create, create, create, create, create, create, create, create, createFile, createNewFile, createNonRecursive, createNonRecursive, createNonRecursive, createPathHandle, createSnapshot, createSnapshot, createSymlink, delete, deleteOnExit, deleteSnapshot, enableSymlinks, exists, fixRelativePart, get, get, get, getAclStatus, getAllStatistics, getAllStoragePolicies, getBlockSize, getCanonicalServiceName, getCanonicalUri, getContentSummary, getDefaultBlockSize, getDefaultBlockSize, getDefaultPort, getDefaultReplication, getDefaultReplication, getDefaultUri, getFileBlockLocations, getFileBlockLocations, getFileChecksum, getFileChecksum, getFileLinkStatus, getFileSystemClass, getFSofPath, getGlobalStorageStatistics, getHomeDirectory, getInitialWorkingDirectory, getLength, getLinkTarget, getLocal, getName, getNamed, getPathHandle, getQuotaUsage, getReplication, getServerDefaults, getServerDefaults, getStatistics, getStatistics, getStatus, getStatus, getStoragePolicy, getStorageStatistics, getTrashRoot, getTrashRoots, getUsed, getUsed, getXAttr, getXAttrs, getXAttrs, globStatus, globStatus, isDirectory, isFile, listCorruptFileBlocks, listFiles, listLocatedStatus, listLocatedStatus, listStatus, listStatus, listStatus, listStatusIterator, listXAttrs, makeQualified, mkdirs, mkdirs, modifyAclEntries, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, msync, newInstance, newInstance, newInstance, newInstanceLocal, open, open, open, primitiveCreate, primitiveMkdir, primitiveMkdir, printStatistics, processDeleteOnExit, removeAcl, removeAclEntries, removeDefaultAcl, removeXAttr, rename, renameSnapshot, resolveLink, resolvePath, satisfyStoragePolicy, setAcl, setDefaultUri, setDefaultUri, setOwner, setPermission, setQuota, setQuotaByStorageType, setReplication, setStoragePolicy, setTimes, setVerifyChecksum, setWriteChecksum, setXAttr, setXAttr, startLocalOutput, supportsSymlinks, truncate, unsetStoragePolicy`

    - ### Methods inherited from class org.apache.hadoop.conf.Configured

      `getConf, setConf`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.hadoop.security.token.DelegationTokenIssuer

      `addDelegationTokens, getAdditionalTokenIssuers, getDelegationToken`

- - ### Constructor Detail

    - #### HttpsFileSystem

          public HttpsFileSystem()

  - ### Method Detail

    - #### 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.
      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
      Throws:
        `IOException` - IO failure
      See Also:
        `FileSystem.setPermission(Path, FsPermission)`

    - #### 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.
      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
      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.

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.