Package org.apache.sshd.sftp.server
Class Handle
java.lang.Object
org.apache.sshd.sftp.server.Handle
- All Implemented Interfaces:
Closeable,AutoCloseable,Channel,AttributeRepository,AttributeStore
- Direct Known Subclasses:
DirectoryHandle,FileHandle
- Author:
- Apache MINA SSHD Project
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.sshd.common.AttributeRepository
AttributeRepository.AttributeKey<T> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHandle(SftpSubsystem subsystem, Path file, String handle) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclose()<T> TcomputeAttributeIfAbsent(AttributeRepository.AttributeKey<T> key, Function<? super AttributeRepository.AttributeKey<T>, ? extends T> resolver) <T> TintgetFile()Retrieves the raw opaque file handle, which may contain characters not safe for printing.protected SftpSubsystembooleanisOpen()<T> Tprotected static StringConverts 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> TsetAttribute(AttributeRepository.AttributeKey<T> key, T value) protected voidprotected voidtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.sshd.common.AttributeRepository
resolveAttribute
-
Constructor Details
-
Handle
-
-
Method Details
-
getSubsystem
-
signalHandleOpening
- Throws:
IOException
-
signalHandleOpen
- Throws:
IOException
-
getFile
-
getFileHandle
Retrieves the raw opaque file handle, which may contain characters not safe for printing.- Returns:
- the raw file handle
-
getAttributesCount
public int getAttributesCount()- Specified by:
getAttributesCountin interfaceAttributeRepository
-
getAttribute
- Specified by:
getAttributein interfaceAttributeRepository
-
attributeKeys
- Specified by:
attributeKeysin interfaceAttributeRepository
-
computeAttributeIfAbsent
public <T> T computeAttributeIfAbsent(AttributeRepository.AttributeKey<T> key, Function<? super AttributeRepository.AttributeKey<T>, ? extends T> resolver) - Specified by:
computeAttributeIfAbsentin interfaceAttributeStore
-
setAttribute
- Specified by:
setAttributein interfaceAttributeStore
-
removeAttribute
- Specified by:
removeAttributein interfaceAttributeStore
-
clearAttributes
public void clearAttributes()- Specified by:
clearAttributesin interfaceAttributeStore
-
isOpen
public boolean isOpen() -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- Throws:
IOException
-
toString
-
safe
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.For historical reasons, Apache MINA sshd represents file handles as strings internally.
- Parameters:
handle- to convert- Returns:
- the printable handle string
-