Package org.apache.sshd.sftp.server
Class FileHandle
java.lang.Object
org.apache.sshd.sftp.server.Handle
org.apache.sshd.sftp.server.FileHandle
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Channel
,AttributeRepository
,AttributeStore
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.sshd.common.AttributeRepository
AttributeRepository.AttributeKey<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final Collection
<FileAttribute<?>> private final SeekableByteChannel
private final Set
<StandardOpenOption> -
Constructor Summary
ConstructorsConstructorDescriptionFileHandle
(SftpSubsystem subsystem, Path file, String handle, int flags, int access, Map<String, Object> attrs) -
Method Summary
Modifier and TypeMethodDescriptionvoid
append
(byte[] data) void
append
(byte[] data, int doff, int length) void
close()
int
final Collection
<FileAttribute<?>> final Set
<StandardOpenOption> static Set
<StandardOpenOption> getOpenOptions
(int flags, int access) boolean
void
lock
(long offset, long length, int mask) int
read
(byte[] data, int doff, int length, long offset) int
read
(byte[] data, int doff, int length, long offset, AtomicReference<Boolean> eof) int
read
(byte[] data, long offset) static FileAttribute
<?> toFileAttribute
(String key, Object val) static Collection
<FileAttribute<?>> toFileAttributes
(Map<String, ?> attrs) void
unlock
(long offset, long length) void
write
(byte[] data, int doff, int length, long offset) void
write
(byte[] data, long offset) Methods inherited from class org.apache.sshd.sftp.server.Handle
attributeKeys, clearAttributes, computeAttributeIfAbsent, getAttribute, getAttributesCount, getFile, getFileHandle, getSubsystem, isOpen, removeAttribute, setAttribute, signalHandleOpen, signalHandleOpening, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.sshd.common.AttributeRepository
resolveAttribute
-
Field Details
-
access
private final int access -
fileChannel
-
locks
-
openOptions
-
fileAttributes
-
-
Constructor Details
-
FileHandle
public FileHandle(SftpSubsystem subsystem, Path file, String handle, int flags, int access, Map<String, Object> attrs) throws IOException- Throws:
IOException
-
-
Method Details
-
getOpenOptions
-
getFileAttributes
-
getFileChannel
-
getAccessMask
public int getAccessMask() -
isOpenAppend
public boolean isOpenAppend() -
read
- Throws:
IOException
-
read
- Throws:
IOException
-
read
public int read(byte[] data, int doff, int length, long offset, AtomicReference<Boolean> eof) throws IOException - Throws:
IOException
-
append
- Throws:
IOException
-
append
- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceChannel
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classHandle
- Throws:
IOException
-
lock
- Throws:
IOException
-
unlock
- Throws:
IOException
-
toFileAttributes
-
toFileAttribute
-
getOpenOptions
-