Class FtpSession
java.lang.Object
org.springframework.integration.ftp.session.FtpSession
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,org.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
public class FtpSession
extends java.lang.Object
implements org.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
Implementation of
Session for FTP.- Since:
- 2.0
-
Constructor Summary
Constructors Constructor Description FtpSession(org.apache.commons.net.ftp.FTPClient client) -
Method Summary
Modifier and Type Method Description voidappend(java.io.InputStream inputStream, java.lang.String path)voidclose()booleanexists(java.lang.String path)booleanfinalizeRaw()org.apache.commons.net.ftp.FTPClientgetClientInstance()java.lang.StringgetHostPort()booleanisOpen()org.apache.commons.net.ftp.FTPFile[]list(java.lang.String path)java.lang.String[]listNames(java.lang.String path)booleanmkdir(java.lang.String remoteDirectory)voidread(java.lang.String path, java.io.OutputStream fos)java.io.InputStreamreadRaw(java.lang.String source)booleanremove(java.lang.String path)voidrename(java.lang.String pathFrom, java.lang.String pathTo)booleanrmdir(java.lang.String directory)booleantest()voidwrite(java.io.InputStream inputStream, java.lang.String path)
-
Constructor Details
-
FtpSession
public FtpSession(org.apache.commons.net.ftp.FTPClient client)
-
-
Method Details
-
remove
public boolean remove(java.lang.String path) throws java.io.IOException- Specified by:
removein interfaceorg.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>- Throws:
java.io.IOException
-
list
public org.apache.commons.net.ftp.FTPFile[] list(java.lang.String path) throws java.io.IOException- Specified by:
listin interfaceorg.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>- Throws:
java.io.IOException
-
listNames
public java.lang.String[] listNames(java.lang.String path) throws java.io.IOException- Specified by:
listNamesin interfaceorg.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>- Throws:
java.io.IOException
-
read
public void read(java.lang.String path, java.io.OutputStream fos) throws java.io.IOException- Specified by:
readin interfaceorg.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>- Throws:
java.io.IOException
-
readRaw
public java.io.InputStream readRaw(java.lang.String source) throws java.io.IOException- Specified by:
readRawin interfaceorg.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>- Throws:
java.io.IOException
-
finalizeRaw
public boolean finalizeRaw() throws java.io.IOException- Specified by:
finalizeRawin interfaceorg.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>- Throws:
java.io.IOException
-
write
public void write(java.io.InputStream inputStream, java.lang.String path) throws java.io.IOException- Specified by:
writein interfaceorg.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>- Throws:
java.io.IOException
-
append
public void append(java.io.InputStream inputStream, java.lang.String path) throws java.io.IOException- Specified by:
appendin interfaceorg.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>- Throws:
java.io.IOException
-
close
public void close()- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceorg.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfaceorg.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
-
rename
public void rename(java.lang.String pathFrom, java.lang.String pathTo) throws java.io.IOException- Specified by:
renamein interfaceorg.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>- Throws:
java.io.IOException
-
mkdir
public boolean mkdir(java.lang.String remoteDirectory) throws java.io.IOException- Specified by:
mkdirin interfaceorg.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>- Throws:
java.io.IOException
-
rmdir
public boolean rmdir(java.lang.String directory) throws java.io.IOException- Specified by:
rmdirin interfaceorg.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>- Throws:
java.io.IOException
-
exists
public boolean exists(java.lang.String path) throws java.io.IOException- Specified by:
existsin interfaceorg.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>- Throws:
java.io.IOException
-
getClientInstance
public org.apache.commons.net.ftp.FTPClient getClientInstance()- Specified by:
getClientInstancein interfaceorg.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
-
getHostPort
public java.lang.String getHostPort()- Specified by:
getHostPortin interfaceorg.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
-
test
public boolean test()- Specified by:
testin interfaceorg.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
-