Class FtpSession
java.lang.Object
org.springframework.integration.ftp.session.FtpSession
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- Session<org.apache.commons.net.ftp.FTPFile>
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidappend(InputStream inputStream, String path) Append to a file.voidclose()booleanCheck if the remote file or directory exists.booleanInvoke after closing the InputStream fromSession.readRaw(String).org.apache.commons.net.ftp.FTPClientGet the underlying client library's client instance for this session.Return the host:port pair this session is connected to.booleanisOpen()org.apache.commons.net.ftp.FTPFile[]String[]booleanvoidread(String path, OutputStream fos) Retrieve a remote file as a rawInputStream.booleanvoidbooleanRemove a remote directory.booleantest()Test the session is still alive, e.g.voidwrite(InputStream inputStream, String path) 
- 
Constructor Details- 
FtpSessionpublic FtpSession(org.apache.commons.net.ftp.FTPClient client) 
 
- 
- 
Method Details- 
remove- Specified by:
- removein interface- Session<org.apache.commons.net.ftp.FTPFile>
- Throws:
- IOException
 
- 
list- Specified by:
- listin interface- Session<org.apache.commons.net.ftp.FTPFile>
- Throws:
- IOException
 
- 
listNames- Specified by:
- listNamesin interface- Session<org.apache.commons.net.ftp.FTPFile>
- Throws:
- IOException
 
- 
read- Specified by:
- readin interface- Session<org.apache.commons.net.ftp.FTPFile>
- Throws:
- IOException
 
- 
readRawDescription copied from interface:SessionRetrieve a remote file as a rawInputStream.- Specified by:
- readRawin interface- Session<org.apache.commons.net.ftp.FTPFile>
- Parameters:
- source- The path of the remote file.
- Returns:
- The raw inputStream.
- Throws:
- IOException- Any IOException.
 
- 
finalizeRawDescription copied from interface:SessionInvoke after closing the InputStream fromSession.readRaw(String). Required by some session providers.- Specified by:
- finalizeRawin interface- Session<org.apache.commons.net.ftp.FTPFile>
- Returns:
- true if successful.
- Throws:
- IOException- Any IOException.
 
- 
write- Specified by:
- writein interface- Session<org.apache.commons.net.ftp.FTPFile>
- Throws:
- IOException
 
- 
appendDescription copied from interface:SessionAppend to a file.- Specified by:
- appendin interface- Session<org.apache.commons.net.ftp.FTPFile>
- Parameters:
- inputStream- the stream.
- path- the destination.
- Throws:
- IOException- an IO Exception.
 
- 
close
- 
isOpen
- 
rename- Specified by:
- renamein interface- Session<org.apache.commons.net.ftp.FTPFile>
- Throws:
- IOException
 
- 
mkdir- Specified by:
- mkdirin interface- Session<org.apache.commons.net.ftp.FTPFile>
- Throws:
- IOException
 
- 
rmdirDescription copied from interface:SessionRemove a remote directory.- Specified by:
- rmdirin interface- Session<org.apache.commons.net.ftp.FTPFile>
- Parameters:
- directory- The directory.
- Returns:
- True if the directory was removed.
- Throws:
- IOException- an IO exception.
 
- 
existsDescription copied from interface:SessionCheck if the remote file or directory exists.- Specified by:
- existsin interface- Session<org.apache.commons.net.ftp.FTPFile>
- Parameters:
- path- the remote path.
- Returns:
- trueor- falseif remote path exists or not.
- Throws:
- IOException- an IO exception during remote interaction.
 
- 
getClientInstancepublic org.apache.commons.net.ftp.FTPClient getClientInstance()Description copied from interface:SessionGet the underlying client library's client instance for this session. Returns anObjectto avoid significant changes to -file, -ftp, -sftp modules, which would be required if we added another generic parameter. Implementations should narrow the return type.- Specified by:
- getClientInstancein interface- Session<org.apache.commons.net.ftp.FTPFile>
- Returns:
- The client instance.
 
- 
getHostPortDescription copied from interface:SessionReturn the host:port pair this session is connected to.- Specified by:
- getHostPortin interface- Session<org.apache.commons.net.ftp.FTPFile>
- Returns:
- the host:port pair this session is connected to.
 
- 
testpublic boolean test()Description copied from interface:SessionTest the session is still alive, e.g. when checking out from a pool. The default implementation simply delegates toSession.isOpen().
 
-