com.nurelm.util
Class FTPUtil

java.lang.Object
  extended bycom.nurelm.util.FTPUtil

public class FTPUtil
extends java.lang.Object

Performs all the heavy lifting required by the ftp tag.


Nested Class Summary
 class FTPUtil.FTPObject
           
 
Field Summary
static int BAD_INPUT
           
static int CONNECTION_REFUSED
           
static int IO_EXCEPTION
           
static int PERMISSION_DENIED_FOR_DIR
           
static int SUCCESS
           
static int USER_PASS_REFUSED
           
 
Constructor Summary
FTPUtil(java.lang.String server, java.lang.String username, java.lang.String password, java.lang.String[] startDirs)
           
 
Method Summary
 int downloadFile(java.lang.String filename, javax.servlet.http.HttpServletResponse response)
          Writes a file output stream of the appropriate type to the response object provided.
 java.lang.String getCurrentDirectory()
           
 java.util.ArrayList getFileListing()
           
 java.util.ArrayList getFolderListing()
           
 java.util.ArrayList getLinkListing()
           
 java.lang.String getServer()
           
 java.lang.String[] getStartDirs()
           
 java.lang.String getTextFile(java.lang.String filename)
          Returns the content of the specified text file if it exists.
 java.lang.String getUsername()
           
 int setListing(java.lang.String requestedDir)
          Gets the listing for the specified directory, and sets the corresponding class variable of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUCCESS

public static final int SUCCESS
See Also:
Constant Field Values

CONNECTION_REFUSED

public static final int CONNECTION_REFUSED
See Also:
Constant Field Values

USER_PASS_REFUSED

public static final int USER_PASS_REFUSED
See Also:
Constant Field Values

PERMISSION_DENIED_FOR_DIR

public static final int PERMISSION_DENIED_FOR_DIR
See Also:
Constant Field Values

BAD_INPUT

public static final int BAD_INPUT
See Also:
Constant Field Values

IO_EXCEPTION

public static final int IO_EXCEPTION
See Also:
Constant Field Values
Constructor Detail

FTPUtil

public FTPUtil(java.lang.String server,
               java.lang.String username,
               java.lang.String password,
               java.lang.String[] startDirs)
Method Detail

setListing

public int setListing(java.lang.String requestedDir)
Gets the listing for the specified directory, and sets the corresponding class variable of this object.


getTextFile

public java.lang.String getTextFile(java.lang.String filename)
Returns the content of the specified text file if it exists.


downloadFile

public int downloadFile(java.lang.String filename,
                        javax.servlet.http.HttpServletResponse response)
Writes a file output stream of the appropriate type to the response object provided.


getServer

public java.lang.String getServer()

getCurrentDirectory

public java.lang.String getCurrentDirectory()

getFileListing

public java.util.ArrayList getFileListing()

getFolderListing

public java.util.ArrayList getFolderListing()

getUsername

public java.lang.String getUsername()

getStartDirs

public java.lang.String[] getStartDirs()

getLinkListing

public java.util.ArrayList getLinkListing()