org.jutil.net
Class FTPBase

java.lang.Object
  extended by org.jutil.net.FTPBase
Direct Known Subclasses:
FTPReaderImpl, FTPWriterImpl

public class FTPBase
extends java.lang.Object

This is the FTPBase class.


Field Summary
protected  java.lang.String CLASS_NAME
           
 
Constructor Summary
FTPBase()
           
 
Method Summary
 boolean changeWorkingDir(java.lang.String dir)
          Change current working directory on the remote host.
protected  boolean connect(java.lang.String host)
          Used to connect to the remote machine and initiate comunication.
protected  void debug(java.lang.String msg)
           
 void disconnect()
          Causes the control port to be disconnected and closed.
 int getReply()
           
 boolean isConnected()
           
 boolean login(java.lang.String user, java.lang.String pass)
          This method is used to authenticate the user.
protected  void print(java.lang.String msg)
           
protected  void println(java.lang.String msg)
           
protected  void prn(java.lang.String msg)
           
protected  void prnCmd(java.lang.String cmd)
           
 void setConnected(boolean connected)
           
 void setDebug(boolean debug)
           
 void setIOMonitor(IOMonitor ioMonitor)
           
protected  void setPrefix(java.lang.String prefix)
           
protected  void traceCmd(java.lang.String cmd)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_NAME

protected final java.lang.String CLASS_NAME
Constructor Detail

FTPBase

public FTPBase()
Method Detail

setPrefix

protected void setPrefix(java.lang.String prefix)

setConnected

public void setConnected(boolean connected)

isConnected

public boolean isConnected()

setDebug

public void setDebug(boolean debug)

setIOMonitor

public void setIOMonitor(IOMonitor ioMonitor)

connect

protected boolean connect(java.lang.String host)
                   throws java.rmi.UnknownHostException,
                          java.io.IOException
Used to connect to the remote machine and initiate comunication. This method only takes care of establishing the control socket. No attempt is made by this method to login.

Parameters:
hostName - Name of the host to connect to.
Returns:
Returns true on success.
Throws:
java.rmi.UnknownHostException
java.io.IOException

login

public boolean login(java.lang.String user,
                     java.lang.String pass)
              throws java.security.GeneralSecurityException
This method is used to authenticate the user.

Parameters:
userName - Name of the user on the remote host.
passWord - Password to send to the remote host.
Returns:
Returns true on success.
Throws:
java.security.GeneralSecurityException

changeWorkingDir

public boolean changeWorkingDir(java.lang.String dir)
Change current working directory on the remote host.

Parameters:
dir - The directory on the remote host to set as current working directory
Returns:
Returns true on success.

disconnect

public void disconnect()
                throws java.io.IOException
Causes the control port to be disconnected and closed. This method also cleans up any data port connection that may be active.

Throws:
java.io.IOException

getReply

public int getReply()

traceCmd

protected void traceCmd(java.lang.String cmd)

prnCmd

protected void prnCmd(java.lang.String cmd)

debug

protected void debug(java.lang.String msg)

prn

protected void prn(java.lang.String msg)

println

protected void println(java.lang.String msg)

print

protected void print(java.lang.String msg)