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
public class FileHandle extends Handle
- Author:
- Apache MINA SSHD Project
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.sshd.common.AttributeRepository
AttributeRepository.AttributeKey<T extends Object>
-
-
Constructor Summary
Constructors Constructor Description FileHandle(SftpSubsystem subsystem, Path file, String handle, int flags, int access, Map<String,Object> attrs)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(byte[] data)voidappend(byte[] data, int doff, int length)voidclose()intgetAccessMask()Collection<FileAttribute<?>>getFileAttributes()SeekableByteChannelgetFileChannel()Set<StandardOpenOption>getOpenOptions()static Set<StandardOpenOption>getOpenOptions(int flags, int access)booleanisOpenAppend()voidlock(long offset, long length, int mask)intread(byte[] data, int doff, int length, long offset)intread(byte[] data, int doff, int length, long offset, AtomicReference<Boolean> eof)intread(byte[] data, long offset)static FileAttribute<?>toFileAttribute(String key, Object val)static Collection<FileAttribute<?>>toFileAttributes(Map<String,?> attrs)voidunlock(long offset, long length)voidwrite(byte[] data, int doff, int length, long offset)voidwrite(byte[] data, long offset)-
Methods inherited from class org.apache.sshd.sftp.server.Handle
attributeKeys, clearAttributes, computeAttributeIfAbsent, getAttribute, getAttributesCount, getFile, getFileHandle, getSubsystem, isOpen, removeAttribute, safe, 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
-
-
-
-
Constructor Detail
-
FileHandle
public FileHandle(SftpSubsystem subsystem, Path file, String handle, int flags, int access, Map<String,Object> attrs) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getOpenOptions
public final Set<StandardOpenOption> getOpenOptions()
-
getFileAttributes
public final Collection<FileAttribute<?>> getFileAttributes()
-
getFileChannel
public SeekableByteChannel getFileChannel()
-
getAccessMask
public int getAccessMask()
-
isOpenAppend
public boolean isOpenAppend()
-
read
public int read(byte[] data, long offset) throws IOException- Throws:
IOException
-
read
public int read(byte[] data, int doff, int length, long offset) throws IOException- Throws:
IOException
-
read
public int read(byte[] data, int doff, int length, long offset, AtomicReference<Boolean> eof) throws IOException- Throws:
IOException
-
append
public void append(byte[] data) throws IOException- Throws:
IOException
-
append
public void append(byte[] data, int doff, int length) throws IOException- Throws:
IOException
-
write
public void write(byte[] data, long offset) throws IOException- Throws:
IOException
-
write
public void write(byte[] data, int doff, int length, long offset) throws IOException- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- Overrides:
closein classHandle- Throws:
IOException
-
lock
public void lock(long offset, long length, int mask) throws IOException- Throws:
IOException
-
unlock
public void unlock(long offset, long length) throws IOException- Throws:
IOException
-
toFileAttributes
public static Collection<FileAttribute<?>> toFileAttributes(Map<String,?> attrs)
-
toFileAttribute
public static FileAttribute<?> toFileAttribute(String key, Object val)
-
getOpenOptions
public static Set<StandardOpenOption> getOpenOptions(int flags, int access)
-
-