public class FileHandle extends Handle
Modifier and Type | Field and Description |
---|---|
private int |
access |
private java.util.Collection<java.nio.file.attribute.FileAttribute<?>> |
fileAttributes |
private java.nio.channels.SeekableByteChannel |
fileChannel |
private java.util.List<java.nio.channels.FileLock> |
locks |
private java.util.Set<java.nio.file.StandardOpenOption> |
openOptions |
private SftpSubsystem |
subsystem |
Constructor and Description |
---|
FileHandle(SftpSubsystem subsystem,
java.nio.file.Path file,
java.lang.String handle,
int flags,
int access,
java.util.Map<java.lang.String,java.lang.Object> attrs) |
Modifier and Type | Method and Description |
---|---|
void |
append(byte[] data) |
void |
append(byte[] data,
int doff,
int length) |
void |
close() |
int |
getAccessMask() |
java.util.Collection<java.nio.file.attribute.FileAttribute<?>> |
getFileAttributes() |
java.nio.channels.SeekableByteChannel |
getFileChannel() |
java.util.Set<java.nio.file.StandardOpenOption> |
getOpenOptions() |
static java.util.Set<java.nio.file.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 java.nio.file.attribute.FileAttribute<?> |
toFileAttribute(java.lang.String key,
java.lang.Object val) |
static java.util.Collection<java.nio.file.attribute.FileAttribute<?>> |
toFileAttributes(java.util.Map<java.lang.String,java.lang.Object> attrs) |
void |
unlock(long offset,
long length) |
void |
write(byte[] data,
int doff,
int length,
long offset) |
void |
write(byte[] data,
long offset) |
getFile, getFileHandle, isOpen, signalHandleOpen, signalHandleOpening, toString
private final int access
private final java.nio.channels.SeekableByteChannel fileChannel
private final java.util.List<java.nio.channels.FileLock> locks
private final SftpSubsystem subsystem
private final java.util.Set<java.nio.file.StandardOpenOption> openOptions
private final java.util.Collection<java.nio.file.attribute.FileAttribute<?>> fileAttributes
public FileHandle(SftpSubsystem subsystem, java.nio.file.Path file, java.lang.String handle, int flags, int access, java.util.Map<java.lang.String,java.lang.Object> attrs) throws java.io.IOException
java.io.IOException
public final java.util.Set<java.nio.file.StandardOpenOption> getOpenOptions()
public final java.util.Collection<java.nio.file.attribute.FileAttribute<?>> getFileAttributes()
public final java.nio.channels.SeekableByteChannel getFileChannel()
public int getAccessMask()
public boolean isOpenAppend()
public int read(byte[] data, long offset) throws java.io.IOException
java.io.IOException
public int read(byte[] data, int doff, int length, long offset) throws java.io.IOException
java.io.IOException
public void append(byte[] data) throws java.io.IOException
java.io.IOException
public void append(byte[] data, int doff, int length) throws java.io.IOException
java.io.IOException
public void write(byte[] data, long offset) throws java.io.IOException
java.io.IOException
public void write(byte[] data, int doff, int length, long offset) throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
public void lock(long offset, long length, int mask) throws java.io.IOException
java.io.IOException
public void unlock(long offset, long length) throws java.io.IOException
java.io.IOException
public static java.util.Collection<java.nio.file.attribute.FileAttribute<?>> toFileAttributes(java.util.Map<java.lang.String,java.lang.Object> attrs)
public static java.nio.file.attribute.FileAttribute<?> toFileAttribute(java.lang.String key, java.lang.Object val)
public static java.util.Set<java.nio.file.StandardOpenOption> getOpenOptions(int flags, int access)