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() |
void |
close() |
<T> T |
computeAttributeIfAbsent(AttributeRepository.AttributeKey<T> key,
Function<? super AttributeRepository.AttributeKey<T>,? extends T> resolver) |
<T> T |
getAttribute(AttributeRepository.AttributeKey<T> key) |
int |
getAttributesCount() |
Path |
getFile() |
String |
getFileHandle()
Retrieves the raw opaque file handle, which may contain characters not safe for printing.
|
protected SftpSubsystem |
getSubsystem() |
boolean |
isOpen() |
<T> T |
removeAttribute(AttributeRepository.AttributeKey<T> key) |
protected static String |
safe(String handle)
Converts a file handle, which may contain non-printable characters, to a hex representation of its bytes, which
is safe to write to logs or exception messages.
|
<T> T |
setAttribute(AttributeRepository.AttributeKey<T> key,
T value) |
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)
getAttribute in interface AttributeRepositorypublic Collection<AttributeRepository.AttributeKey<?>> attributeKeys()
attributeKeys in interface AttributeRepositorypublic <T> T computeAttributeIfAbsent(AttributeRepository.AttributeKey<T> key, Function<? super AttributeRepository.AttributeKey<T>,? extends T> resolver)
computeAttributeIfAbsent in interface AttributeStorepublic <T> T setAttribute(AttributeRepository.AttributeKey<T> key, T value)
setAttribute in interface AttributeStorepublic <T> T removeAttribute(AttributeRepository.AttributeKey<T> key)
removeAttribute in interface AttributeStorepublic void clearAttributes()
clearAttributes in interface AttributeStorepublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface ChannelIOExceptionprotected static String safe(String handle)
For historical reasons, Apache MINA sshd represents file handles as strings internally.
handle - to convertCopyright © 2018–2024 The Apache Software Foundation. All rights reserved.