Class SftpSession
java.lang.Object
org.springframework.integration.sftp.session.SftpSession
- All Implemented Interfaces:
Closeable,AutoCloseable,org.springframework.integration.file.remote.session.Session<com.jcraft.jsch.ChannelSftp.LsEntry>
public class SftpSession
extends Object
implements org.springframework.integration.file.remote.session.Session<com.jcraft.jsch.ChannelSftp.LsEntry>
Default SFTP
Session implementation. Wraps a JSCH session instance.- Since:
- 2.0
-
Constructor Summary
ConstructorsConstructorDescriptionSftpSession(com.jcraft.jsch.Session jschSession) SftpSession(org.springframework.integration.sftp.session.JSchSessionWrapper wrapper) -
Method Summary
Modifier and TypeMethodDescriptionvoidappend(InputStream inputStream, String destination) voidclose()booleanbooleancom.jcraft.jsch.ChannelSftpbooleanisOpen()com.jcraft.jsch.ChannelSftp.LsEntry[]String[]booleanvoidread(String source, OutputStream os) booleanvoidbooleanvoidsetChannelConnectTimeout(Duration timeout) Set the connect timeout.booleantest()voidwrite(InputStream inputStream, String destination) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.integration.file.remote.session.Session
dirty
-
Constructor Details
-
SftpSession
public SftpSession(com.jcraft.jsch.Session jschSession) -
SftpSession
public SftpSession(org.springframework.integration.sftp.session.JSchSessionWrapper wrapper)
-
-
Method Details
-
setChannelConnectTimeout
Set the connect timeout.- Parameters:
timeout- the timeout to set.- Since:
- 5.2
-
remove
- Specified by:
removein interfaceorg.springframework.integration.file.remote.session.Session<com.jcraft.jsch.ChannelSftp.LsEntry>- Throws:
IOException
-
list
- Specified by:
listin interfaceorg.springframework.integration.file.remote.session.Session<com.jcraft.jsch.ChannelSftp.LsEntry>- Throws:
IOException
-
listNames
- Specified by:
listNamesin interfaceorg.springframework.integration.file.remote.session.Session<com.jcraft.jsch.ChannelSftp.LsEntry>- Throws:
IOException
-
read
- Specified by:
readin interfaceorg.springframework.integration.file.remote.session.Session<com.jcraft.jsch.ChannelSftp.LsEntry>- Throws:
IOException
-
readRaw
- Specified by:
readRawin interfaceorg.springframework.integration.file.remote.session.Session<com.jcraft.jsch.ChannelSftp.LsEntry>- Throws:
IOException
-
finalizeRaw
public boolean finalizeRaw()- Specified by:
finalizeRawin interfaceorg.springframework.integration.file.remote.session.Session<com.jcraft.jsch.ChannelSftp.LsEntry>
-
write
- Specified by:
writein interfaceorg.springframework.integration.file.remote.session.Session<com.jcraft.jsch.ChannelSftp.LsEntry>- Throws:
IOException
-
append
- Specified by:
appendin interfaceorg.springframework.integration.file.remote.session.Session<com.jcraft.jsch.ChannelSftp.LsEntry>- Throws:
IOException
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.springframework.integration.file.remote.session.Session<com.jcraft.jsch.ChannelSftp.LsEntry>
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfaceorg.springframework.integration.file.remote.session.Session<com.jcraft.jsch.ChannelSftp.LsEntry>
-
rename
- Specified by:
renamein interfaceorg.springframework.integration.file.remote.session.Session<com.jcraft.jsch.ChannelSftp.LsEntry>- Throws:
IOException
-
mkdir
- Specified by:
mkdirin interfaceorg.springframework.integration.file.remote.session.Session<com.jcraft.jsch.ChannelSftp.LsEntry>- Throws:
IOException
-
rmdir
- Specified by:
rmdirin interfaceorg.springframework.integration.file.remote.session.Session<com.jcraft.jsch.ChannelSftp.LsEntry>- Throws:
IOException
-
exists
- Specified by:
existsin interfaceorg.springframework.integration.file.remote.session.Session<com.jcraft.jsch.ChannelSftp.LsEntry>
-
getClientInstance
public com.jcraft.jsch.ChannelSftp getClientInstance()- Specified by:
getClientInstancein interfaceorg.springframework.integration.file.remote.session.Session<com.jcraft.jsch.ChannelSftp.LsEntry>
-
getHostPort
- Specified by:
getHostPortin interfaceorg.springframework.integration.file.remote.session.Session<com.jcraft.jsch.ChannelSftp.LsEntry>
-
test
public boolean test()- Specified by:
testin interfaceorg.springframework.integration.file.remote.session.Session<com.jcraft.jsch.ChannelSftp.LsEntry>
-