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>
-
-
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 void
append(byte[] data)
void
append(byte[] data, int doff, int length)
void
close()
int
getAccessMask()
Collection<FileAttribute<?>>
getFileAttributes()
SeekableByteChannel
getFileChannel()
Set<StandardOpenOption>
getOpenOptions()
static Set<StandardOpenOption>
getOpenOptions(int flags, int access)
boolean
isOpenAppend()
void
lock(long offset, long length, int mask)
int
read(byte[] data, int doff, int length, long offset)
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
-
-
-
-
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
-
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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceChannel
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in 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)
-
-