public final class SftpOutputStream extends OutputStream implements ConnectedTestable
Instances of this class are not safe for use by multiple threads.
| Modifier and Type | Class and Description |
|---|---|
static class |
SftpOutputStream.WriteMode
File transfer mode.
|
| Constructor and Description |
|---|
SftpOutputStream(SftpChannel channel,
String path)
Create a new SFTP output stream in OVERWRITE mode.
|
SftpOutputStream(SftpChannel channel,
String path,
SftpOutputStream.WriteMode mode)
Create a new SFTP output stream.
|
SftpOutputStream(SftpChannel channel,
String path,
SftpOutputStream.WriteMode mode,
long offset)
Create a new SFTP output stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
boolean |
isConnected()
Answer whether this object is currently connected.
|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
public SftpOutputStream(SftpChannel channel, String path) throws NotConnectedException
channel - The SFTP channelpath - The file pathIllegalArgumentException - if the SFTP channel is nullIllegalArgumentException - if the path is null or blankNotConnectedException - in case of being not connectedpublic SftpOutputStream(SftpChannel channel, String path, SftpOutputStream.WriteMode mode) throws NotConnectedException
channel - The SFTP channelpath - The file pathmode - The write mode (OVERWRITE, RESUME or APPEND)IllegalArgumentException - if the SFTP channel is nullIllegalArgumentException - if the path is null or blankNotConnectedException - in case of being not connectedpublic SftpOutputStream(SftpChannel channel, String path, SftpOutputStream.WriteMode mode, long offset) throws NotConnectedException
channel - The SFTP channelpath - The file pathmode - The write mode (OVERWRITE, RESUME or APPEND)offset - The data will be added at offsetIllegalArgumentException - if the SFTP channel is nullIllegalArgumentException - if the path is null or blankNotConnectedException - in case of being not connectedpublic boolean isConnected()
ConnectedTestableisConnected in interface ConnectedTestablepublic final void write(int b)
write in class OutputStreampublic final void write(byte[] b)
write in class OutputStreampublic final void write(byte[] b,
int off,
int len)
write in class OutputStreampublic final void flush()
flush in interface Flushableflush in class OutputStreampublic final void close()
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamCopyright © 2019. All rights reserved.