public class FileHandle extends Handle
AttributeRepository.AttributeKey<T>
Constructor and Description |
---|
FileHandle(SftpSubsystem subsystem,
Path file,
String handle,
int flags,
int access,
Map<String,Object> attrs) |
Modifier and Type | Method and 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) |
attributeKeys, clearAttributes, computeAttributeIfAbsent, getAttribute, getAttributesCount, getFile, getFileHandle, getSubsystem, isOpen, removeAttribute, setAttribute, signalHandleOpen, signalHandleOpening, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
ofAttributesMap, ofKeyValuePair, resolveAttribute
public FileHandle(SftpSubsystem subsystem, Path file, String handle, int flags, int access, Map<String,Object> attrs) throws IOException
IOException
public final Set<StandardOpenOption> getOpenOptions()
public final Collection<FileAttribute<?>> getFileAttributes()
public SeekableByteChannel getFileChannel()
public int getAccessMask()
public boolean isOpenAppend()
public int read(byte[] data, long offset) throws IOException
IOException
public int read(byte[] data, int doff, int length, long offset) throws IOException
IOException
public void append(byte[] data) throws IOException
IOException
public void append(byte[] data, int doff, int length) throws IOException
IOException
public void write(byte[] data, long offset) throws IOException
IOException
public void write(byte[] data, int doff, int length, long offset) throws IOException
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in interface Channel
close
in class Handle
IOException
public void lock(long offset, long length, int mask) throws IOException
IOException
public void unlock(long offset, long length) throws IOException
IOException
public static Collection<FileAttribute<?>> toFileAttributes(Map<String,?> attrs)
public static FileAttribute<?> toFileAttribute(String key, Object val)
public static Set<StandardOpenOption> getOpenOptions(int flags, int access)
Copyright © 2018–2021 The Apache Software Foundation. All rights reserved.