Interface PathCapabilities

All Known Implementing Classes:
AbstractFileSystem, ChecksumFileSystem, ChecksumFs, DelegateToFileSystem, FileContext, FileSystem, FilterFileSystem, FilterFs, FTPFileSystem, FtpFs, HarFileSystem, HarFs, HttpFileSystem, HttpsFileSystem, LocalFileSystem, LocalFs, RawLocalFileSystem, RawLocalFs, SFTPFileSystem, ViewFileSystem, ViewFileSystemOverloadScheme, ViewFs

public interface PathCapabilities
The Path counterpoint to StreamCapabilities; a query to see if, a FileSystem/FileContext instance has a specific capability under the given path. Other classes may also implement the interface, as desired. See CommonPathCapabilities for the well-known capabilities.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    hasPathCapability(Path path, String capability)
    Probe for a specific capability under the given path.
  • Method Details

    • hasPathCapability

      boolean hasPathCapability(Path path, String capability) throws IOException
      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.

      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.
      IllegalArgumentException - invalid arguments