Class SftpSession
java.lang.Object
org.springframework.integration.sftp.session.SftpSession
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.springframework.integration.file.remote.session.Session<org.apache.sshd.sftp.client.SftpClient.DirEntry>
public class SftpSession
extends Object
implements org.springframework.integration.file.remote.session.Session<org.apache.sshd.sftp.client.SftpClient.DirEntry>
Default SFTP
Session
implementation. Wraps a MINA SSHD session instance.- Since:
- 2.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
append
(InputStream inputStream, String destination) void
close()
Stream<org.apache.sshd.sftp.client.SftpClient.DirEntry>
boolean
boolean
org.apache.sshd.sftp.client.SftpClient
boolean
isOpen()
org.apache.sshd.sftp.client.SftpClient.DirEntry[]
String[]
boolean
void
read
(String source, OutputStream os) boolean
void
boolean
boolean
test()
void
write
(InputStream inputStream, String destination) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.integration.file.remote.session.Session
dirty
-
Constructor Details
-
SftpSession
public SftpSession(org.apache.sshd.sftp.client.SftpClient sftpClient)
-
-
Method Details
-
remove
- Specified by:
remove
in interfaceorg.springframework.integration.file.remote.session.Session<org.apache.sshd.sftp.client.SftpClient.DirEntry>
- Throws:
IOException
-
list
- Specified by:
list
in interfaceorg.springframework.integration.file.remote.session.Session<org.apache.sshd.sftp.client.SftpClient.DirEntry>
- Throws:
IOException
-
listNames
- Specified by:
listNames
in interfaceorg.springframework.integration.file.remote.session.Session<org.apache.sshd.sftp.client.SftpClient.DirEntry>
- Throws:
IOException
-
doList
public Stream<org.apache.sshd.sftp.client.SftpClient.DirEntry> doList(String path) throws IOException - Throws:
IOException
-
read
- Specified by:
read
in interfaceorg.springframework.integration.file.remote.session.Session<org.apache.sshd.sftp.client.SftpClient.DirEntry>
- Throws:
IOException
-
readRaw
- Specified by:
readRaw
in interfaceorg.springframework.integration.file.remote.session.Session<org.apache.sshd.sftp.client.SftpClient.DirEntry>
- Throws:
IOException
-
finalizeRaw
public boolean finalizeRaw()- Specified by:
finalizeRaw
in interfaceorg.springframework.integration.file.remote.session.Session<org.apache.sshd.sftp.client.SftpClient.DirEntry>
-
write
- Specified by:
write
in interfaceorg.springframework.integration.file.remote.session.Session<org.apache.sshd.sftp.client.SftpClient.DirEntry>
- Throws:
IOException
-
append
- Specified by:
append
in interfaceorg.springframework.integration.file.remote.session.Session<org.apache.sshd.sftp.client.SftpClient.DirEntry>
- Throws:
IOException
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceorg.springframework.integration.file.remote.session.Session<org.apache.sshd.sftp.client.SftpClient.DirEntry>
-
isOpen
public boolean isOpen()- Specified by:
isOpen
in interfaceorg.springframework.integration.file.remote.session.Session<org.apache.sshd.sftp.client.SftpClient.DirEntry>
-
rename
- Specified by:
rename
in interfaceorg.springframework.integration.file.remote.session.Session<org.apache.sshd.sftp.client.SftpClient.DirEntry>
- Throws:
IOException
-
mkdir
- Specified by:
mkdir
in interfaceorg.springframework.integration.file.remote.session.Session<org.apache.sshd.sftp.client.SftpClient.DirEntry>
- Throws:
IOException
-
rmdir
- Specified by:
rmdir
in interfaceorg.springframework.integration.file.remote.session.Session<org.apache.sshd.sftp.client.SftpClient.DirEntry>
- Throws:
IOException
-
exists
- Specified by:
exists
in interfaceorg.springframework.integration.file.remote.session.Session<org.apache.sshd.sftp.client.SftpClient.DirEntry>
-
getClientInstance
public org.apache.sshd.sftp.client.SftpClient getClientInstance()- Specified by:
getClientInstance
in interfaceorg.springframework.integration.file.remote.session.Session<org.apache.sshd.sftp.client.SftpClient.DirEntry>
-
getHostPort
- Specified by:
getHostPort
in interfaceorg.springframework.integration.file.remote.session.Session<org.apache.sshd.sftp.client.SftpClient.DirEntry>
-
test
public boolean test()- Specified by:
test
in interfaceorg.springframework.integration.file.remote.session.Session<org.apache.sshd.sftp.client.SftpClient.DirEntry>
-