public abstract class Handle extends Object implements Channel, AttributeStore
AttributeRepository.AttributeKey<T>| Modifier | Constructor and Description |
|---|---|
protected |
Handle(SftpSubsystem subsystem,
Path file,
String handle) |
| Modifier and Type | Method and Description |
|---|---|
Collection<AttributeRepository.AttributeKey<?>> |
attributeKeys() |
void |
clearAttributes()
Removes all currently stored user-defined attributes
|
void |
close() |
<T> T |
computeAttributeIfAbsent(AttributeRepository.AttributeKey<T> key,
Function<? super AttributeRepository.AttributeKey<T>,? extends T> resolver)
If the specified key is not already associated with a value (or is mapped to
null), attempts to compute
its value using the given mapping function and enters it into this map unless null. |
<T> T |
getAttribute(AttributeRepository.AttributeKey<T> key)
Returns the value of the user-defined attribute.
|
int |
getAttributesCount() |
Path |
getFile() |
String |
getFileHandle() |
protected SftpSubsystem |
getSubsystem() |
boolean |
isOpen() |
<T> T |
removeAttribute(AttributeRepository.AttributeKey<T> key)
Removes the user-defined attribute
|
<T> T |
setAttribute(AttributeRepository.AttributeKey<T> key,
T value)
Sets a user-defined attribute.
|
protected void |
signalHandleOpen() |
protected void |
signalHandleOpening() |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitofAttributesMap, ofKeyValuePair, resolveAttributeprotected Handle(SftpSubsystem subsystem, Path file, String handle)
protected SftpSubsystem getSubsystem()
protected void signalHandleOpening()
throws IOException
IOExceptionprotected void signalHandleOpen()
throws IOException
IOExceptionpublic Path getFile()
public String getFileHandle()
public int getAttributesCount()
getAttributesCount in interface AttributeRepositorypublic <T> T getAttribute(AttributeRepository.AttributeKey<T> key)
AttributeRepositorygetAttribute in interface AttributeRepositoryT - The generic attribute typekey - The key of the attribute; must not be null.null if there is no value associated with the specified keypublic Collection<AttributeRepository.AttributeKey<?>> attributeKeys()
attributeKeys in interface AttributeRepositoryCollection snapshot of all the currently registered attributes in the repositorypublic <T> T computeAttributeIfAbsent(AttributeRepository.AttributeKey<T> key, Function<? super AttributeRepository.AttributeKey<T>,? extends T> resolver)
AttributeStorenull), attempts to compute
its value using the given mapping function and enters it into this map unless null.computeAttributeIfAbsent in interface AttributeStoreT - The generic attribute typekey - The key of the attribute; must not be null.resolver - The (never null) mapping function to use if value not already mapped. If returns
null then value is not mapped to the provided key.null if value not mapped and resolver did not return a
non-null value for itpublic <T> T setAttribute(AttributeRepository.AttributeKey<T> key, T value)
AttributeStoresetAttribute in interface AttributeStoreT - The generic attribute typekey - The key of the attribute; must not be null.value - The value of the attribute; must not be null.null if it is new.public <T> T removeAttribute(AttributeRepository.AttributeKey<T> key)
AttributeStoreremoveAttribute in interface AttributeStoreT - The generic attribute typekey - The key of the attribute; must not be null.null if no previous valuepublic void clearAttributes()
AttributeStoreclearAttributes in interface AttributeStorepublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface ChannelIOExceptionCopyright © 2008–2025 The Apache Software Foundation. All rights reserved.