Spring Integration

org.springframework.integration.ftp.session
Class FtpSession

java.lang.Object
  extended by org.springframework.integration.ftp.session.FtpSession
All Implemented Interfaces:
ExtendedSession<org.apache.commons.net.ftp.FTPFile>, Session<org.apache.commons.net.ftp.FTPFile>

public class FtpSession
extends java.lang.Object
implements ExtendedSession<org.apache.commons.net.ftp.FTPFile>

Implementation of Session for FTP.

Since:
2.0
Author:
Mark Fisher, Oleg Zhurakousky, Gary Russell

Constructor Summary
FtpSession(org.apache.commons.net.ftp.FTPClient client)
           
 
Method Summary
 void close()
           
 boolean exists(java.lang.String path)
           
 boolean isOpen()
           
 org.apache.commons.net.ftp.FTPFile[] list(java.lang.String path)
           
 java.lang.String[] listNames(java.lang.String path)
          Returns an array of Strings containing just the names of the remote files at path.
 boolean mkdir(java.lang.String remoteDirectory)
           
 void read(java.lang.String path, java.io.OutputStream fos)
           
 boolean remove(java.lang.String path)
           
 void rename(java.lang.String pathFrom, java.lang.String pathTo)
           
 void write(java.io.InputStream inputStream, java.lang.String path)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FtpSession

public FtpSession(org.apache.commons.net.ftp.FTPClient client)
Method Detail

remove

public boolean remove(java.lang.String path)
               throws java.io.IOException
Specified by:
remove in interface 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:
list in interface 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
Description copied from interface: ExtendedSession
Returns an array of Strings containing just the names of the remote files at path. Will move to Session in 2.2.

Specified by:
listNames in interface ExtendedSession<org.apache.commons.net.ftp.FTPFile>
Parameters:
path - The path
Returns:
The list of names
Throws:
java.io.IOException

read

public void read(java.lang.String path,
                 java.io.OutputStream fos)
          throws java.io.IOException
Specified by:
read in interface 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:
write in interface Session<org.apache.commons.net.ftp.FTPFile>
Throws:
java.io.IOException

close

public void close()
Specified by:
close in interface Session<org.apache.commons.net.ftp.FTPFile>

isOpen

public boolean isOpen()
Specified by:
isOpen in interface 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:
rename in interface 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:
mkdir in interface 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:
exists in interface Session<org.apache.commons.net.ftp.FTPFile>
Throws:
java.io.IOException

Spring Integration