com.ibm.di.protocols
Class FTPClient

java.lang.Object
  extended by com.ibm.di.protocols.FTPClient

public class FTPClient
extends Object


Constructor Summary
FTPClient()
           
 
Method Summary
 void checkComplete()
           
 void connect(String host, int port)
           
 String cwd(String cwd)
           
 void deleteFile(String remoteFile)
           
 String[] dir()
           
 String[] dir(String path, boolean longlisting)
           
 void disconnect()
           
 boolean getDebug()
           
 Socket getFile(String remoteFile, boolean binary)
           
 void getFile(String remoteFile, String localFile, boolean binary)
           
 String getResponse()
           
 boolean getUsePassive()
          Returns true if we should try to use passive mode.
 String[] list()
           
 Socket list(String path, boolean longlisting)
           
 void login(String user, String password)
           
 Socket putFile(String remoteFile, boolean binary)
           
 void putFile(String localPath, String remoteFile, boolean binary)
           
 String pwd()
          Get the current remote working directory
 void rename(String from, String to)
          Rename a file or directory
 String sendCommand(String cmd)
           
 void setDebug(boolean debug)
           
 void setTimeout(int millis)
           
 void setTransferMode(boolean binary)
           
 void setupDataSocket()
           
 void setUsePassive(boolean value)
          Sets this FTPClient to use passive mode (or not)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FTPClient

public FTPClient()
Method Detail

setTimeout

public void setTimeout(int millis)

setDebug

public void setDebug(boolean debug)

getDebug

public boolean getDebug()

connect

public void connect(String host,
                    int port)
             throws Exception
Throws:
Exception

disconnect

public void disconnect()

login

public void login(String user,
                  String password)
           throws Exception
Throws:
Exception

cwd

public String cwd(String cwd)
           throws Exception
Throws:
Exception

setupDataSocket

public void setupDataSocket()
                     throws Exception
Throws:
Exception

getFile

public Socket getFile(String remoteFile,
                      boolean binary)
               throws Exception
Throws:
Exception

getFile

public void getFile(String remoteFile,
                    String localFile,
                    boolean binary)
             throws Exception
Throws:
Exception

putFile

public Socket putFile(String remoteFile,
                      boolean binary)
               throws Exception
Throws:
Exception

putFile

public void putFile(String localPath,
                    String remoteFile,
                    boolean binary)
             throws Exception
Throws:
Exception

setTransferMode

public void setTransferMode(boolean binary)
                     throws Exception
Throws:
Exception

deleteFile

public void deleteFile(String remoteFile)
                throws Exception
Throws:
Exception

rename

public void rename(String from,
                   String to)
            throws Exception
Rename a file or directory

Parameters:
from - name of file or directory to rename
to - intended name
Throws:
Exception

pwd

public String pwd()
           throws Exception
Get the current remote working directory

Returns:
the current working directory
Throws:
Exception

sendCommand

public String sendCommand(String cmd)
                   throws Exception
Throws:
Exception

dir

public String[] dir()
             throws Exception
Throws:
Exception

list

public String[] list()
              throws Exception
Throws:
Exception

dir

public String[] dir(String path,
                    boolean longlisting)
             throws Exception
Throws:
Exception

checkComplete

public void checkComplete()
                   throws Exception
Throws:
Exception

list

public Socket list(String path,
                   boolean longlisting)
            throws Exception
Throws:
Exception

getResponse

public String getResponse()
                   throws Exception
Throws:
Exception

setUsePassive

public void setUsePassive(boolean value)
Sets this FTPClient to use passive mode (or not)

Parameters:
value - If true, try to use passive mode before falling back to the old PORT mode. If false, never use passive mode.

getUsePassive

public boolean getUsePassive()
Returns true if we should try to use passive mode.