Class SpringSftpSession
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.sftp.spring.integration.SpringSftpSession
-
- All Implemented Interfaces:
Closeable,AutoCloseable,org.springframework.integration.file.remote.session.Session<SftpClient.DirEntry>
public class SpringSftpSession extends org.apache.sshd.common.util.logging.AbstractLoggingBean implements org.springframework.integration.file.remote.session.Session<SftpClient.DirEntry>
Implements the Spring session for the SFTP client- Author:
- Apache MINA SSHD Project
-
-
Constructor Summary
Constructors Constructor Description SpringSftpSession(SftpClient clientInstance)SpringSftpSession(SftpClient clientInstance, Callable<Exception> sessionCloser)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(InputStream inputStream, String destination)voidclose()protected voidcloseClientInstance(SftpClient client)protected voidcloseSessionInstance(Callable<Exception> closer)booleanexists(String path)booleanfinalizeRaw()SftpClientgetClientInstance()StringgetHostPort()Callable<Exception>getSessionCloser()booleanisOpen()SftpClient.DirEntry[]list(String path)String[]listNames(String path)booleanmkdir(String directory)voidread(String source, OutputStream outputStream)InputStreamreadRaw(String source)booleanremove(String path)voidrename(String pathFrom, String pathTo)booleanrmdir(String directory)StringtoString()voidwrite(InputStream inputStream, String destination)-
Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
-
-
-
-
Constructor Detail
-
SpringSftpSession
public SpringSftpSession(SftpClient clientInstance)
-
SpringSftpSession
public SpringSftpSession(SftpClient clientInstance, Callable<Exception> sessionCloser)
-
-
Method Detail
-
getHostPort
public String getHostPort()
- Specified by:
getHostPortin interfaceorg.springframework.integration.file.remote.session.Session<SftpClient.DirEntry>
-
isOpen
public boolean isOpen()
- Specified by:
isOpenin interfaceorg.springframework.integration.file.remote.session.Session<SftpClient.DirEntry>
-
getClientInstance
public SftpClient getClientInstance()
- Specified by:
getClientInstancein interfaceorg.springframework.integration.file.remote.session.Session<SftpClient.DirEntry>
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.springframework.integration.file.remote.session.Session<SftpClient.DirEntry>
-
closeClientInstance
protected void closeClientInstance(SftpClient client) throws Exception
- Throws:
Exception
-
closeSessionInstance
protected void closeSessionInstance(Callable<Exception> closer) throws Exception
- Throws:
Exception
-
remove
public boolean remove(String path) throws IOException
- Specified by:
removein interfaceorg.springframework.integration.file.remote.session.Session<SftpClient.DirEntry>- Throws:
IOException
-
mkdir
public boolean mkdir(String directory) throws IOException
- Specified by:
mkdirin interfaceorg.springframework.integration.file.remote.session.Session<SftpClient.DirEntry>- Throws:
IOException
-
rmdir
public boolean rmdir(String directory) throws IOException
- Specified by:
rmdirin interfaceorg.springframework.integration.file.remote.session.Session<SftpClient.DirEntry>- Throws:
IOException
-
rename
public void rename(String pathFrom, String pathTo) throws IOException
- Specified by:
renamein interfaceorg.springframework.integration.file.remote.session.Session<SftpClient.DirEntry>- Throws:
IOException
-
exists
public boolean exists(String path) throws IOException
- Specified by:
existsin interfaceorg.springframework.integration.file.remote.session.Session<SftpClient.DirEntry>- Throws:
IOException
-
listNames
public String[] listNames(String path) throws IOException
- Specified by:
listNamesin interfaceorg.springframework.integration.file.remote.session.Session<SftpClient.DirEntry>- Throws:
IOException
-
list
public SftpClient.DirEntry[] list(String path) throws IOException
- Specified by:
listin interfaceorg.springframework.integration.file.remote.session.Session<SftpClient.DirEntry>- Throws:
IOException
-
read
public void read(String source, OutputStream outputStream) throws IOException
- Specified by:
readin interfaceorg.springframework.integration.file.remote.session.Session<SftpClient.DirEntry>- Throws:
IOException
-
write
public void write(InputStream inputStream, String destination) throws IOException
- Specified by:
writein interfaceorg.springframework.integration.file.remote.session.Session<SftpClient.DirEntry>- Throws:
IOException
-
append
public void append(InputStream inputStream, String destination) throws IOException
- Specified by:
appendin interfaceorg.springframework.integration.file.remote.session.Session<SftpClient.DirEntry>- Throws:
IOException
-
readRaw
public InputStream readRaw(String source) throws IOException
- Specified by:
readRawin interfaceorg.springframework.integration.file.remote.session.Session<SftpClient.DirEntry>- Throws:
IOException
-
finalizeRaw
public boolean finalizeRaw() throws IOException- Specified by:
finalizeRawin interfaceorg.springframework.integration.file.remote.session.Session<SftpClient.DirEntry>- Throws:
IOException
-
-