org.mule.transport.sftp
Class SftpInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.io.BufferedInputStream
org.mule.transport.sftp.SftpInputStream
- All Implemented Interfaces:
- Closeable, ErrorOccurredDecorator
public class SftpInputStream
- extends BufferedInputStream
- implements ErrorOccurredDecorator
SftpInputStream
wraps an sftp InputStream.
SftpInputStream
public SftpInputStream(SftpClient client,
InputStream is,
String fileName,
boolean autoDelete,
ImmutableEndpoint endpoint)
throws Exception
- A special sftp InputStream. The constructor creates the InputStream by calling
SftpClient.retrieveFile(fileName)
. The client passed in is
destroyed when the stream is closed.
- Parameters:
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.
- Throws:
Exception
- if failing to retrieve internal input stream.
getFileName
public String getFileName()
setFileName
public void setFileName(String fileName)
read
public int read()
throws IOException
- Overrides:
read
in class BufferedInputStream
- Throws:
IOException
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Overrides:
read
in class BufferedInputStream
- Throws:
IOException
read
public int read(byte[] b)
throws IOException
- Overrides:
read
in class FilterInputStream
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class BufferedInputStream
- Throws:
IOException
setErrorOccurred
public void setErrorOccurred()
- Specified by:
setErrorOccurred
in interface ErrorOccurredDecorator
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.