public class SftpSession extends java.lang.Object implements Session<com.jcraft.jsch.ChannelSftp.LsEntry>
Session
implementation. Wraps a JSCH session instance.Constructor and Description |
---|
SftpSession(org.springframework.integration.sftp.session.JSchSessionWrapper wrapper) |
SftpSession(com.jcraft.jsch.Session jschSession) |
Modifier and Type | Method and Description |
---|---|
void |
append(java.io.InputStream inputStream,
java.lang.String destination)
Append to a file.
|
void |
close() |
boolean |
exists(java.lang.String path)
Check if the remote file or directory exists.
|
boolean |
finalizeRaw()
Invoke after closing the InputStream from
Session.readRaw(String) . |
com.jcraft.jsch.ChannelSftp |
getClientInstance()
Get the underlying client library's client instance for this session.
|
boolean |
isOpen() |
com.jcraft.jsch.ChannelSftp.LsEntry[] |
list(java.lang.String path) |
java.lang.String[] |
listNames(java.lang.String path) |
boolean |
mkdir(java.lang.String remoteDirectory) |
void |
read(java.lang.String source,
java.io.OutputStream os) |
java.io.InputStream |
readRaw(java.lang.String source)
Retrieve a remote file as a raw
InputStream . |
boolean |
remove(java.lang.String path) |
void |
rename(java.lang.String pathFrom,
java.lang.String pathTo) |
boolean |
rmdir(java.lang.String remoteDirectory)
Remove a remote directory.
|
void |
write(java.io.InputStream inputStream,
java.lang.String destination) |
public SftpSession(com.jcraft.jsch.Session jschSession)
public SftpSession(org.springframework.integration.sftp.session.JSchSessionWrapper wrapper)
public boolean remove(java.lang.String path) throws java.io.IOException
public com.jcraft.jsch.ChannelSftp.LsEntry[] list(java.lang.String path) throws java.io.IOException
public java.lang.String[] listNames(java.lang.String path) throws java.io.IOException
public void read(java.lang.String source, java.io.OutputStream os) throws java.io.IOException
public java.io.InputStream readRaw(java.lang.String source) throws java.io.IOException
Session
InputStream
.public boolean finalizeRaw() throws java.io.IOException
Session
Session.readRaw(String)
.
Required by some session providers.finalizeRaw
in interface Session<com.jcraft.jsch.ChannelSftp.LsEntry>
java.io.IOException
- Any IOException.public void write(java.io.InputStream inputStream, java.lang.String destination) throws java.io.IOException
public void append(java.io.InputStream inputStream, java.lang.String destination) throws java.io.IOException
Session
public void close()
public boolean isOpen()
public void rename(java.lang.String pathFrom, java.lang.String pathTo) throws java.io.IOException
public boolean mkdir(java.lang.String remoteDirectory) throws java.io.IOException
public boolean rmdir(java.lang.String remoteDirectory) throws java.io.IOException
Session
public boolean exists(java.lang.String path)
Session
public com.jcraft.jsch.ChannelSftp getClientInstance()
Session
Object
to avoid significant changes to -file, -ftp, -sftp
modules, which would be required
if we added another generic parameter. Implementations should narrow the
return type.getClientInstance
in interface Session<com.jcraft.jsch.ChannelSftp.LsEntry>