Package org.apache.sshd.sftp.client.impl
Class SftpOutputStreamAsync
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.sshd.common.util.io.output.OutputStreamWithChannel
-
- org.apache.sshd.sftp.client.impl.SftpOutputStreamAsync
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable,java.nio.channels.Channel,SftpClientHolder
public class SftpOutputStreamAsync extends OutputStreamWithChannel implements SftpClientHolder
Implements an output stream for a given remote file
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]bbprotected Bufferbufferprotected intbufferSizeprivate AbstractSftpClientclientInstanceprotected SftpClient.CloseableHandlehandleprotected org.slf4j.Loggerlogprotected longoffsetprivate java.lang.Stringpathprotected java.util.Deque<SftpAckData>pendingWrites
-
Constructor Summary
Constructors Constructor Description SftpOutputStreamAsync(AbstractSftpClient client, int bufferSize, java.lang.String path, java.util.Collection<SftpClient.OpenMode> mode)SftpOutputStreamAsync(AbstractSftpClient client, int bufferSize, java.lang.String path, SftpClient.CloseableHandle handle)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()AbstractSftpClientgetClient()java.lang.StringgetPath()The remotely accessed file pathbooleanisOpen()voidsetOffset(long offset)java.lang.StringtoString()voidwrite(byte[] b, int off, int len)voidwrite(int b)
-
-
-
Field Detail
-
log
protected final org.slf4j.Logger log
-
bb
protected final byte[] bb
-
bufferSize
protected final int bufferSize
-
buffer
protected Buffer buffer
-
handle
protected SftpClient.CloseableHandle handle
-
offset
protected long offset
-
pendingWrites
protected final java.util.Deque<SftpAckData> pendingWrites
-
clientInstance
private final AbstractSftpClient clientInstance
-
path
private final java.lang.String path
-
-
Constructor Detail
-
SftpOutputStreamAsync
public SftpOutputStreamAsync(AbstractSftpClient client, int bufferSize, java.lang.String path, java.util.Collection<SftpClient.OpenMode> mode) throws java.io.IOException
- Throws:
java.io.IOException
-
SftpOutputStreamAsync
public SftpOutputStreamAsync(AbstractSftpClient client, int bufferSize, java.lang.String path, SftpClient.CloseableHandle handle) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
getClient
public final AbstractSftpClient getClient()
- Specified by:
getClientin interfaceSftpClientHolder
-
setOffset
public void setOffset(long offset)
-
getPath
public final java.lang.String getPath()
The remotely accessed file path- Returns:
- Remote file path
-
isOpen
public boolean isOpen()
- Specified by:
isOpenin interfacejava.nio.channels.Channel
-
write
public void write(int b) throws java.io.IOException- Specified by:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] b, int off, int len) throws java.io.IOException- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.OutputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.nio.channels.Channel- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.OutputStream- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-