public class SftpRemotePathChannel extends FileChannel
FileChannel.MapMode| Modifier and Type | Field and Description |
|---|---|
protected AtomicReference<Thread> |
blockingThreadHolder |
protected boolean |
closeOnExit |
protected SftpClient.CloseableHandle |
handle |
protected Object |
lock |
protected org.slf4j.Logger |
log |
protected Collection<SftpClient.OpenMode> |
modes |
protected AtomicLong |
posTracker |
static Set<SftpClient.OpenMode> |
READ_MODES |
protected SftpClient |
sftp |
static Set<SftpClient.OpenMode> |
WRITE_MODES |
| Constructor and Description |
|---|
SftpRemotePathChannel(String path,
SftpClient sftp,
boolean closeOnExit,
Collection<SftpClient.OpenMode> modes) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
beginBlocking(Object actionHint) |
protected long |
doRead(Collection<? extends ByteBuffer> buffers,
long position) |
protected long |
doWrite(Collection<? extends ByteBuffer> buffers,
long position) |
protected void |
endBlocking(Object actionHint,
boolean completed) |
void |
force(boolean metaData) |
String |
getRemotePath() |
protected void |
implCloseChannel() |
FileLock |
lock(long position,
long size,
boolean shared) |
MappedByteBuffer |
map(FileChannel.MapMode mode,
long position,
long size) |
long |
position() |
FileChannel |
position(long newPosition) |
int |
read(ByteBuffer dst) |
long |
read(ByteBuffer[] dsts,
int offset,
int length) |
int |
read(ByteBuffer dst,
long position) |
long |
size() |
String |
toString() |
long |
transferFrom(ReadableByteChannel src,
long position,
long count) |
long |
transferTo(long position,
long count,
WritableByteChannel target) |
FileChannel |
truncate(long size) |
FileLock |
tryLock(long position,
long size,
boolean shared) |
int |
write(ByteBuffer src) |
long |
write(ByteBuffer[] srcs,
int offset,
int length) |
int |
write(ByteBuffer src,
long position) |
begin, close, end, isOpenpublic static final Set<SftpClient.OpenMode> READ_MODES
public static final Set<SftpClient.OpenMode> WRITE_MODES
protected final org.slf4j.Logger log
protected final Collection<SftpClient.OpenMode> modes
protected final boolean closeOnExit
protected final SftpClient sftp
protected final SftpClient.CloseableHandle handle
protected final Object lock
protected final AtomicLong posTracker
protected final AtomicReference<Thread> blockingThreadHolder
public SftpRemotePathChannel(String path, SftpClient sftp, boolean closeOnExit, Collection<SftpClient.OpenMode> modes) throws IOException
IOExceptionpublic String getRemotePath()
public int read(ByteBuffer dst) throws IOException
read in interface ReadableByteChannelread in interface SeekableByteChannelread in class FileChannelIOExceptionpublic int read(ByteBuffer dst, long position) throws IOException
read in class FileChannelIOExceptionpublic long read(ByteBuffer[] dsts, int offset, int length) throws IOException
read in interface ScatteringByteChannelread in class FileChannelIOExceptionprotected long doRead(Collection<? extends ByteBuffer> buffers, long position) throws IOException
IOExceptionpublic int write(ByteBuffer src) throws IOException
write in interface SeekableByteChannelwrite in interface WritableByteChannelwrite in class FileChannelIOExceptionpublic int write(ByteBuffer src, long position) throws IOException
write in class FileChannelIOExceptionpublic long write(ByteBuffer[] srcs, int offset, int length) throws IOException
write in interface GatheringByteChannelwrite in class FileChannelIOExceptionprotected long doWrite(Collection<? extends ByteBuffer> buffers, long position) throws IOException
IOExceptionpublic long position()
throws IOException
position in interface SeekableByteChannelposition in class FileChannelIOExceptionpublic FileChannel position(long newPosition) throws IOException
position in interface SeekableByteChannelposition in class FileChannelIOExceptionpublic long size()
throws IOException
size in interface SeekableByteChannelsize in class FileChannelIOExceptionpublic FileChannel truncate(long size) throws IOException
truncate in interface SeekableByteChanneltruncate in class FileChannelIOExceptionpublic void force(boolean metaData)
throws IOException
force in class FileChannelIOExceptionpublic long transferTo(long position,
long count,
WritableByteChannel target)
throws IOException
transferTo in class FileChannelIOExceptionpublic long transferFrom(ReadableByteChannel src, long position, long count) throws IOException
transferFrom in class FileChannelIOExceptionpublic MappedByteBuffer map(FileChannel.MapMode mode, long position, long size) throws IOException
map in class FileChannelIOExceptionpublic FileLock lock(long position, long size, boolean shared) throws IOException
lock in class FileChannelIOExceptionpublic FileLock tryLock(long position, long size, boolean shared) throws IOException
tryLock in class FileChannelIOExceptionprotected void implCloseChannel()
throws IOException
implCloseChannel in class AbstractInterruptibleChannelIOExceptionprotected void beginBlocking(Object actionHint)
protected void endBlocking(Object actionHint, boolean completed) throws AsynchronousCloseException
AsynchronousCloseExceptionCopyright © 2018–2021 The Apache Software Foundation. All rights reserved.