Package org.apache.sshd.sftp.client.fs
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
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description voidsetAttributes(SftpClient.Attributes attributes)Sets the attributes.static <T> TwithAttributeCache(java.nio.file.Path path, IOFunction<java.nio.file.Path,T> operation)Performs the given operation with attribute caching, if the givenPathimplements theWithFileAttributeCacheinterface, otherwise simply executes the operation.<T> TwithAttributeCache(IOFunction<java.nio.file.Path,T> operation)Performs the given operation with attribute caching.-
Methods inherited from interface org.apache.sshd.sftp.client.fs.WithFileAttributes
getAttributes
-
-
-
-
Method Detail
-
setAttributes
void setAttributes(SftpClient.Attributes attributes)
Sets the attributes.- Parameters:
attributes-SftpClient.Attributesto set
-
withAttributeCache
<T> T withAttributeCache(IOFunction<java.nio.file.Path,T> operation) throws java.io.IOException
Performs the given operation with attribute caching. IfSftpClient.Attributesare fetched by the operation, they will be cached and subsequently these cached attributes will be re-used for thisSftpPathinstance throughout the operation. Calls towithAttributeCache(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 theoperation- Parameters:
operation- to perform; may returnnullif it has no result- Returns:
- the result of the
operation - Throws:
java.io.IOException- if thrown by theoperation
-
withAttributeCache
static <T> T withAttributeCache(java.nio.file.Path path, IOFunction<java.nio.file.Path,T> operation) throws java.io.IOExceptionPerforms the given operation with attribute caching, if the givenPathimplements theWithFileAttributeCacheinterface, otherwise simply executes the operation.- Type Parameters:
T- result type of theoperation- Parameters:
path-Pathto operate onoperation- to perform; may returnnullif it has no result- Returns:
- the result of the
operation - Throws:
java.io.IOException- if thrown by theoperation- See Also:
withAttributeCache(IOFunction)
-
-