dea.common
Class FtpUtils

java.lang.Object
  extended bydea.common.FtpUtils
All Implemented Interfaces:
IDebugLevels

public class FtpUtils
extends java.lang.Object
implements IDebugLevels

This class is for ftp actions from other classes

User: dea Date: Dec 24, 2004 Time: 10:56:43 PM From RFC 959 October 1985 File Transfer Protocol Connection Establishment 120 220 220 421 Login USER 230 530 500, 501, 421 331, 332 PASS 230 202 530 500, 501, 503, 421 332 ACCT 230 202 530 500, 501, 503, 421 CWD 250 500, 501, 502, 421, 530, 550 CDUP 200 500, 501, 502, 421, 530, 550 SMNT 202, 250 500, 501, 502, 421, 530, 550 Logout REIN 120 220 220 421 500, 502 QUIT 221 500 Transfer parameters PORT 200 500, 501, 421, 530 PASV 227 500, 501, 502, 421, 530 MODE 200 500, 501, 504, 421, 530 TYPE 200 500, 501, 504, 421, 530 STRU 200 500, 501, 504, 421, 530 File action commands ALLO 200 202 500, 501, 504, 421, 530 REST 500, 501, 502, 421, 530 350 STOR 125, 150 (110) 226, 250 425, 426, 451, 551, 552 532, 450, 452, 553 500, 501, 421, 530 STOU 125, 150 (110) 226, 250 425, 426, 451, 551, 552 532, 450, 452, 553 500, 501, 421, 530 RETR 125, 150 (110) 226, 250 425, 426, 451 450, 550 500, 501, 421, 530 LIST 125, 150 226, 250 425, 426, 451 450 500, 501, 502, 421, 530 NLST 125, 150 226, 250 425, 426, 451 450 500, 501, 502, 421, 530 APPE 125, 150 (110) 226, 250 425, 426, 451, 551, 552 532, 450, 550, 452, 553 500, 501, 502, 421, 530 RNFR 450, 550 500, 501, 502, 421, 530 350 RNTO 250 532, 553 500, 501, 502, 503, 421, 530 DELE 250 450, 550 500, 501, 502, 421, 530 RMD 250 500, 501, 502, 421, 530, 550 MKD 257 500, 501, 502, 421, 530, 550 PWD 257 500, 501, 502, 421, 550 ABOR 225, 226 500, 501, 502, 421 Informational commands SYST 215 500, 501, 502, 421 STAT 211, 212, 213 450 500, 501, 502, 421, 530 HELP 211, 214 500, 501, 502, 421 Miscellaneous commands SITE 200 202 500, 501, 530 NOOP 200 500 421



Rev 1.1 fix setBinary to ignores 2nd call so mode is not toggled back to ascii


Field Summary
protected static Display display
          Get connection to display / log utils
 
Fields inherited from interface dea.common.IDebugLevels
BASIC, DEBUG_ALL, ERROR, METH_DETAIL, METH_ENTER, METH_EXIT, METH_EXT, METH_GET, METH_SET, METH_VARS, SHOW_PASS
 
Constructor Summary
FtpUtils()
           
 
Method Summary
 java.lang.String chdir(java.lang.String dir)
          Change the remote working directory to that supplied
 void close()
          close down connection
 java.lang.String login(java.lang.String hostAddr, java.lang.String ftpUser, java.lang.String ftpPasswd)
          Connect to the server
 java.lang.String mkdir(java.lang.String dir)
          Create the specified remote working directory
 java.lang.String putBinary(java.lang.String localPath, java.lang.String remoteFile)
          Put as binary, write raw bytes
 java.lang.String setBinary()
          Set transfer stream to binary mode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

display

protected static Display display
Get connection to display / log utils

Constructor Detail

FtpUtils

public FtpUtils()
Method Detail

login

public java.lang.String login(java.lang.String hostAddr,
                              java.lang.String ftpUser,
                              java.lang.String ftpPasswd)
                       throws java.io.IOException
Connect to the server

Throws:
java.io.IOException

close

public void close()
close down connection


mkdir

public java.lang.String mkdir(java.lang.String dir)
                       throws java.io.IOException
Create the specified remote working directory

Parameters:
dir - name of remote directory to create
Throws:
java.io.IOException

chdir

public java.lang.String chdir(java.lang.String dir)
                       throws java.io.IOException
Change the remote working directory to that supplied

Parameters:
dir - name of remote directory to change to
Throws:
java.io.IOException

setBinary

public java.lang.String setBinary()
                           throws java.io.IOException
Set transfer stream to binary mode

Returns:
reply from server
Throws:
java.io.IOException

putBinary

public java.lang.String putBinary(java.lang.String localPath,
                                  java.lang.String remoteFile)
                           throws java.io.IOException
Put as binary, write raw bytes

Parameters:
localPath - full path of local file to read from
remoteFile - name of remote file we are writing to
Throws:
java.io.IOException


Copyright © 2001-2005 Round Mountain Rescue Ranch. All Rights Reserved.