public class SftpInputStream extends BufferedInputStream implements ErrorOccurredDecorator
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() |
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 void setErrorOccurred()
setErrorOccurred
in interface ErrorOccurredDecorator
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.