Package org.apache.sshd.sftp.client.impl
Class SftpRemotePathChannel
java.lang.Object
java.nio.channels.spi.AbstractInterruptibleChannel
java.nio.channels.FileChannel
org.apache.sshd.sftp.client.impl.SftpRemotePathChannel
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ByteChannel
,Channel
,GatheringByteChannel
,InterruptibleChannel
,ReadableByteChannel
,ScatteringByteChannel
,SeekableByteChannel
,WritableByteChannel
- Author:
- Apache MINA SSHD Project
-
Nested Class Summary
Nested classes/interfaces inherited from class java.nio.channels.FileChannel
FileChannel.MapMode
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AtomicReference<Thread>
protected final boolean
protected final SftpClient.CloseableHandle
protected final Object
protected final org.slf4j.Logger
protected final Collection<SftpClient.OpenMode>
protected final AtomicLong
static final Set<SftpClient.OpenMode>
protected final SftpClient
static final Set<SftpClient.OpenMode>
-
Constructor Summary
ConstructorsConstructorDescriptionSftpRemotePathChannel
(String path, SftpClient sftp, boolean closeOnExit, Collection<SftpClient.OpenMode> modes) -
Method Summary
Modifier and TypeMethodDescriptionprotected 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) protected void
lock
(long position, long size, boolean shared) map
(FileChannel.MapMode mode, long position, long size) long
position()
position
(long newPosition) int
read
(ByteBuffer dst) long
read
(ByteBuffer[] dsts, int offset, int length) int
read
(ByteBuffer dst, long position) long
size()
toString()
long
transferFrom
(ReadableByteChannel src, long position, long count) long
transferTo
(long position, long count, WritableByteChannel target) truncate
(long size) 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) Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel
begin, close, end, isOpen
-
Field Details
-
READ_MODES
-
WRITE_MODES
-
log
protected final org.slf4j.Logger log -
modes
-
closeOnExit
protected final boolean closeOnExit -
sftp
-
handle
-
lock
-
posTracker
-
blockingThreadHolder
-
-
Constructor Details
-
SftpRemotePathChannel
public SftpRemotePathChannel(String path, SftpClient sftp, boolean closeOnExit, Collection<SftpClient.OpenMode> modes) throws IOException - Throws:
IOException
-
-
Method Details
-
getRemotePath
-
read
- Specified by:
read
in interfaceReadableByteChannel
- Specified by:
read
in interfaceSeekableByteChannel
- Specified by:
read
in classFileChannel
- Throws:
IOException
-
read
- Specified by:
read
in classFileChannel
- Throws:
IOException
-
read
- Specified by:
read
in interfaceScatteringByteChannel
- Specified by:
read
in classFileChannel
- Throws:
IOException
-
doRead
- Throws:
IOException
-
write
- Specified by:
write
in interfaceSeekableByteChannel
- Specified by:
write
in interfaceWritableByteChannel
- Specified by:
write
in classFileChannel
- Throws:
IOException
-
write
- Specified by:
write
in classFileChannel
- Throws:
IOException
-
write
- Specified by:
write
in interfaceGatheringByteChannel
- Specified by:
write
in classFileChannel
- Throws:
IOException
-
doWrite
- Throws:
IOException
-
position
- Specified by:
position
in interfaceSeekableByteChannel
- Specified by:
position
in classFileChannel
- Throws:
IOException
-
position
- Specified by:
position
in interfaceSeekableByteChannel
- Specified by:
position
in classFileChannel
- Throws:
IOException
-
size
- Specified by:
size
in interfaceSeekableByteChannel
- Specified by:
size
in classFileChannel
- Throws:
IOException
-
truncate
- Specified by:
truncate
in interfaceSeekableByteChannel
- Specified by:
truncate
in classFileChannel
- Throws:
IOException
-
force
- Specified by:
force
in classFileChannel
- Throws:
IOException
-
transferTo
- Specified by:
transferTo
in classFileChannel
- Throws:
IOException
-
transferFrom
- Specified by:
transferFrom
in classFileChannel
- Throws:
IOException
-
map
- Specified by:
map
in classFileChannel
- Throws:
IOException
-
lock
- Specified by:
lock
in classFileChannel
- Throws:
IOException
-
tryLock
- Specified by:
tryLock
in classFileChannel
- Throws:
IOException
-
implCloseChannel
- Specified by:
implCloseChannel
in classAbstractInterruptibleChannel
- Throws:
IOException
-
beginBlocking
-
endBlocking
- Throws:
AsynchronousCloseException
-
toString
-