public class SftpInputStream extends BufferedInputStream
SftpInputStream
wraps an sftp InputStream.in
Constructor and Description |
---|
SftpInputStream(SftpClient client,
InputStream is,
String fileName,
boolean autoDelete,
ImmutableEndpoint endpoint)
A special sftp InputStream.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
String |
getFileName() |
boolean |
isClosed() |
void |
performPostProcessingOnClose(boolean postProcessOnClose)
Specifies if
postProcess() should be executed when the stream is closed |
void |
postProcess()
Executes post processing actions like closing connections,
deleting/moving files, etc...
|
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
void |
setErrorOccurred() |
void |
setFileName(String fileName) |
String |
toString() |
available, mark, markSupported, reset, skip
public SftpInputStream(SftpClient client, InputStream is, String fileName, boolean autoDelete, ImmutableEndpoint endpoint) throws Exception
SftpClient.retrieveFile(fileName)
. The client passed in is
destroyed when the stream is closed.client
- The SftpClient instance. Will be destroyed when stream closed.is
- The stream that should be usedfileName
- name of the file to be retrievedautoDelete
- whether the file specified by fileName should be deletedendpoint
- the endpoint associated to a specific client (connector) pool.Exception
- if failing to retrieve internal input stream.public String getFileName()
public void setFileName(String fileName)
public int read() throws IOException
read
in class BufferedInputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class BufferedInputStream
IOException
public int read(byte[] b) throws IOException
read
in class FilterInputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class BufferedInputStream
IOException
public boolean isClosed()
public void postProcess() throws Exception
Exception
public void setErrorOccurred()
public void performPostProcessingOnClose(boolean postProcessOnClose)
postProcess()
should be executed when the stream is closedpostProcessOnClose
- a boolean
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.