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
-
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 booleanprotected final SftpClient.CloseableHandleprotected final Objectprotected final org.slf4j.Loggerprotected final Collection<SftpClient.OpenMode>private final Stringprotected final AtomicLongstatic final Set<SftpClient.OpenMode>protected final SftpClientstatic final Set<SftpClient.OpenMode> -
Constructor Summary
ConstructorsConstructorDescriptionSftpRemotePathChannel(String path, SftpClient sftp, boolean closeOnExit, Collection<SftpClient.OpenMode> modes) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbeginBlocking(Object actionHint) protected longdoRead(Collection<? extends ByteBuffer> buffers, long position) protected longdoWrite(Collection<? extends ByteBuffer> buffers, long position) protected voidendBlocking(Object actionHint, boolean completed) private voidensureOpen(Collection<SftpClient.OpenMode> reqModes) Checks that the channel is open and that its current mode contains at least one of the required onesvoidforce(boolean metaData) protected voidlock(long position, long size, boolean shared) map(FileChannel.MapMode mode, long position, long size) longposition()position(long newPosition) intread(ByteBuffer dst) longread(ByteBuffer[] dsts, int offset, int length) intread(ByteBuffer dst, long position) longsize()toString()longtransferFrom(ReadableByteChannel src, long position, long count) longtransferTo(long position, long count, WritableByteChannel target) truncate(long size) tryLock(long position, long size, boolean shared) intwrite(ByteBuffer src) longwrite(ByteBuffer[] srcs, int offset, int length) intwrite(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
-
path
-
-
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:
readin interfaceReadableByteChannel- Specified by:
readin interfaceSeekableByteChannel- Specified by:
readin classFileChannel- Throws:
IOException
-
read
- Specified by:
readin classFileChannel- Throws:
IOException
-
read
- Specified by:
readin interfaceScatteringByteChannel- Specified by:
readin classFileChannel- Throws:
IOException
-
doRead
- Throws:
IOException
-
write
- Specified by:
writein interfaceSeekableByteChannel- Specified by:
writein interfaceWritableByteChannel- Specified by:
writein classFileChannel- Throws:
IOException
-
write
- Specified by:
writein classFileChannel- Throws:
IOException
-
write
- Specified by:
writein interfaceGatheringByteChannel- Specified by:
writein classFileChannel- Throws:
IOException
-
doWrite
- Throws:
IOException
-
position
- Specified by:
positionin interfaceSeekableByteChannel- Specified by:
positionin classFileChannel- Throws:
IOException
-
position
- Specified by:
positionin interfaceSeekableByteChannel- Specified by:
positionin classFileChannel- Throws:
IOException
-
size
- Specified by:
sizein interfaceSeekableByteChannel- Specified by:
sizein classFileChannel- Throws:
IOException
-
truncate
- Specified by:
truncatein interfaceSeekableByteChannel- Specified by:
truncatein classFileChannel- Throws:
IOException
-
force
- Specified by:
forcein classFileChannel- Throws:
IOException
-
transferTo
- Specified by:
transferToin classFileChannel- Throws:
IOException
-
transferFrom
- Specified by:
transferFromin classFileChannel- Throws:
IOException
-
map
- Specified by:
mapin classFileChannel- Throws:
IOException
-
lock
- Specified by:
lockin classFileChannel- Throws:
IOException
-
tryLock
- Specified by:
tryLockin classFileChannel- Throws:
IOException
-
implCloseChannel
- Specified by:
implCloseChannelin classAbstractInterruptibleChannel- Throws:
IOException
-
beginBlocking
-
endBlocking
- Throws:
AsynchronousCloseException
-
ensureOpen
Checks that the channel is open and that its current mode contains at least one of the required ones- Parameters:
reqModes- The required modes - ignored ifnull/empty- Throws:
IOException- If channel not open or the required modes are not satisfied
-
toString
-