Class SftpOutputStreamWithChannel
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.sshd.common.util.io.OutputStreamWithChannel
-
- org.apache.sshd.client.subsystem.sftp.SftpOutputStreamWithChannel
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable,java.nio.channels.Channel
public class SftpOutputStreamWithChannel extends OutputStreamWithChannel
Implements an output stream for a given remote file
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]bbprivate byte[]bufferprivate SftpClientclientprivate SftpClient.CloseableHandlehandleprivate intindexprivate longoffsetprivate java.lang.Stringpath
-
Constructor Summary
Constructors Constructor Description SftpOutputStreamWithChannel(SftpClient client, int bufferSize, java.lang.String path, java.util.Collection<SftpClient.OpenMode> mode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()SftpClientgetClient()The client instancejava.lang.StringgetPath()The remotely accessed file pathbooleanisOpen()voidwrite(byte[] b, int off, int len)voidwrite(int b)
-
-
-
Field Detail
-
client
private final SftpClient client
-
path
private final java.lang.String path
-
bb
private final byte[] bb
-
buffer
private final byte[] buffer
-
index
private int index
-
handle
private SftpClient.CloseableHandle handle
-
offset
private long offset
-
-
Constructor Detail
-
SftpOutputStreamWithChannel
public SftpOutputStreamWithChannel(SftpClient client, int bufferSize, java.lang.String path, java.util.Collection<SftpClient.OpenMode> mode) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
getClient
public final SftpClient getClient()
The client instance- Returns:
SftpClientinstance used to access the remote file
-
getPath
public final java.lang.String getPath()
The remotely accessed file path- Returns:
- Remote file path
-
isOpen
public boolean isOpen()
-
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
-
-