Interface WithFileAttributeCache

All Superinterfaces:
WithFileAttributes
All Known Implementing Classes:
SftpPathImpl

public interface WithFileAttributeCache extends WithFileAttributes
A mix-in interface for paths that can carry and cache file attributes of the referenced file.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Sets the attributes.
    static <T> T
    withAttributeCache(Path path, org.apache.sshd.common.util.io.functors.IOFunction<Path,T> operation)
    Performs the given operation with attribute caching, if the given Path implements the WithFileAttributeCache interface, otherwise simply executes the operation.
    <T> T
    withAttributeCache(org.apache.sshd.common.util.io.functors.IOFunction<Path,T> operation)
    Performs the given operation with attribute caching.

    Methods inherited from interface org.apache.sshd.sftp.client.fs.WithFileAttributes

    getAttributes
  • Method Details

    • setAttributes

      void setAttributes(SftpClient.Attributes attributes)
      Sets the attributes.
      Parameters:
      attributes - SftpClient.Attributes to set
    • withAttributeCache

      <T> T withAttributeCache(org.apache.sshd.common.util.io.functors.IOFunction<Path,T> operation) throws IOException
      Performs the given operation with attribute caching. If SftpClient.Attributes are fetched by the operation, they will be cached and subsequently these cached attributes will be re-used for this SftpPath instance throughout the operation. Calls to withAttributeCache(IOFunction) may be nested. The cache is cleared at the start and at the end of the outermost invocation.
      Type Parameters:
      T - result type of the operation
      Parameters:
      operation - to perform; may return null if it has no result
      Returns:
      the result of the operation
      Throws:
      IOException - if thrown by the operation
    • withAttributeCache

      static <T> T withAttributeCache(Path path, org.apache.sshd.common.util.io.functors.IOFunction<Path,T> operation) throws IOException
      Performs the given operation with attribute caching, if the given Path implements the WithFileAttributeCache interface, otherwise simply executes the operation.
      Type Parameters:
      T - result type of the operation
      Parameters:
      path - Path to operate on
      operation - to perform; may return null if it has no result
      Returns:
      the result of the operation
      Throws:
      IOException - if thrown by the operation
      See Also: