ElegantJCharts Java API Specification v2.0

com.elegantj.net.ftp
Class UserPI

java.lang.Object
  |
  +--com.elegantj.net.ftp.UserPI

public class UserPI
extends java.lang.Object

This class encapsulates User Protocol Interpreter process (UserPI).


Field Summary
static int DEFAULT_FTP_PORT
           
 
Constructor Summary
UserPI()
          Constructs an empty UserPI with default FTP port 21.
 
Method Summary
 void addStatusListener(StatusListener l)
           
 void fireStatusChanged(StatusEvent e)
           
 java.lang.String getHostName()
          Method which returns the name of FTP Server host of this UserPI.
 java.lang.String getPassword()
          Method which returns the password of this UserPI.
 int getPort()
          Method which returns the FTP port of this UserPI.
 UserDTP getUserDTP()
          Method which returns the UserDTP for this UserPI.
 java.lang.String getUserName()
          Method which returns the username of this UserPI.
 boolean isExistControlConnection()
          Method to get status of control connection.
 void removeStatusListener(StatusListener l)
           
 void sendABORCommand()
          Method to send ABOR command to FTP Server.
 void sendACCTCommand(java.lang.String accInfo)
          Method to send ACCT command to FTP Server.
 void sendALLOCommand(int i)
          Method to send ALLO command to FTP Server.
 void sendAPPECommand(java.lang.String fileName)
          Method to upload the specified local file on to FTP server.
 void sendCDUPCommand()
          Method to send CDUP command to FTP Server.
 void sendCWDCommand(java.lang.String path)
          Method to send CWD command to FTP Server.
 void sendDELECommand(java.lang.String path)
          Method to send DELE command to FTP Server.
 void sendHELPCommand()
          Method to send HELP command to FTP Server.
 void sendHELPCommand(java.lang.String command)
          Method to send HELP command to FTP Server.
 java.lang.String sendLISTCommand()
          Method to send LIST command to FTP Server.
 java.lang.String sendLISTCommand(java.lang.String path)
          Method to send LIST command to FTP Server.
 void sendMKDCommand(java.lang.String path)
          Method to send MKD command to FTP Server.
 void sendMODECommand(java.lang.String mode)
          Method to send MODE command to FTP Server.
 java.lang.String sendNLSTCommand()
          Method to send NLST command to FTP Server.
 java.lang.String sendNLSTCommand(java.lang.String path)
          Method to send NLST command to FTP Server.
 void sendNOOPCommand()
          Method to send NOOP command to FTP Server.
 boolean sendPASSCommand(java.lang.String pass)
          Method to send PASS command to FTP Server.
 void sendPASVCommand()
          Method to send PASV command to FTP Server.
 void sendPORTCommand(java.lang.String hostAndPort)
          Method to send PORT command to FTP Server.
 java.lang.String sendPWDCommand()
          Method to send PWD command to FTP Server.
 boolean sendQUITCommand()
          Method to send QUIT command to FTP Server.
 void sendREINCommand()
          Method to send REIN command to FTP Server.
 void sendRESTCommand(long restartPoint)
          Method to send REST command to FTP Server.
 void sendRETRCommand(java.lang.String remotePath, java.lang.String localPath)
          Method to download specified remote file as a name specified in localPath.
 void sendRETRCommand(java.lang.String remotePath, java.lang.String localPath, long restart)
          Method to download specified remote file as a name specified in localPath and with resumed point.
 void sendRMDCommand(java.lang.String path)
          Method to send RMD command to FTP Server.
 void sendRNFRCommand(java.lang.String path)
          Method to send RNFR command to FTP Server.
 void sendRNTOCommand(java.lang.String path)
          Method to send RNTO command to FTP Server.
 void sendSITECommand(java.lang.String string)
          Method to send SITE command to FTP Server.
 void sendSMNTCommand(java.lang.String path)
          Method to send SMNT command to FTP Server.
 void sendSTATCommand()
          Method to send STAT command to FTP Server.
 void sendSTATCommand(java.lang.String path)
          Method to send STAT command to FTP Server.
 void sendSTORCommand(java.lang.String fileName, java.lang.String path)
          Method to upload the specified local file on to FTP server.
 void sendSTOUCommand(java.lang.String fileName)
          Method to upload the specified local file on to FTP server with a new unique name given by server.
 void sendSTRUCommand(java.lang.String structure)
          Method to send STRU command to FTP Server.
 void sendSYSTCommand()
          Method to send SYST command to FTP Server.
 void sendTYPECommand(java.lang.String type)
          Method to send TYPE command to FTP Server.
 boolean sendUSERCommand(java.lang.String user)
          Method to send USER command to FTP Server.
 void setHostName(java.lang.String host)
          Method to set the name of FTP Server host for this UserPI.
 void setPassword(java.lang.String password)
          Method to set the password for logging into FTP Server.
 void setPort(int port)
          Method to set the FTP port for this UserPI.
 void setUserName(java.lang.String username)
          Method to set the username for logging into FTP Server.
 void userPICloseControlConnection()
          Method to close conrol connection.
 void userPICloseDataConnection()
          Method to close the data connection.
 void userPICloseReceiveAsciDataConnection()
          Method to close data connection to receive asci data.
 void userPICloseReceiveBinaryDataConnection()
          Method to close data connection to receive binary data.
 void userPICloseSendAsciDataConnection()
          Method to close data connection to send asci data.
 void userPICloseSendBinaryDataConnection()
          Method to close data connection to send binary data.
 java.lang.String userPIGetAsciData()
          Method to get the ascii data from data connection.
 void userPIGetBinaryData(java.io.File file)
          Method to get binary data from data connection and save it in a local file.
 void userPIGetBinaryData(java.io.File file, long restartPoint)
          Method to get binary data from data connection and save it in a local file.
 java.lang.String userPIGetPortParam(java.lang.String host, int port)
          Method to get parameter for PORT command (32 bit IP + 16 bit TCP port) for non-local host.
 java.lang.String userPIGetPortParamLocalHost()
          Method to get parameter for PORT command (32 bit IP + 16 bit TCP port) for local host.
 java.lang.String userPIGetServerResponse()
          Method to get the responce from FTP Server.
 boolean userPIOpenControlConnection()
          Method to open the conrol connection.
 void userPIOpenReceiveAsciDataConnection()
          Method to open data connection to receive asci data.
 void userPIOpenReceiveBinaryDataConnection()
          Method to open data connection to receive binary data.
 void userPIOpenSendAsciDataConnection()
          Method to open data connection to send asci data.
 void userPIOpenSendBinaryDataConnection()
          Method to open data connection to send binary data.
 void userPISendBinaryData(java.io.File file)
          Method to send binary data from a local file to FTP server on data connection.
 void userPISendBinaryData(java.io.File file, long restartPoint)
          Method to send binary data from a local file to FTP server on data connection.
 void userPISendCommand(java.lang.String command)
          Method to send the FTP command to FTP server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FTP_PORT

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

UserPI

public UserPI()
Constructs an empty UserPI with default FTP port 21.

Method Detail

addStatusListener

public void addStatusListener(StatusListener l)

removeStatusListener

public void removeStatusListener(StatusListener l)

fireStatusChanged

public void fireStatusChanged(StatusEvent e)

setHostName

public void setHostName(java.lang.String host)
Method to set the name of FTP Server host for this UserPI.

Parameters:
host - The name of FTP Server host for this UserPI.

getHostName

public java.lang.String getHostName()
Method which returns the name of FTP Server host of this UserPI.

Returns:
The name of FTP Server host of this UserPI.

setPort

public void setPort(int port)
Method to set the FTP port for this UserPI.

Parameters:
port - The FTP port for this UserPI.

getPort

public int getPort()
Method which returns the FTP port of this UserPI.

Returns:
The FTP port of this UserPI.

setUserName

public void setUserName(java.lang.String username)
Method to set the username for logging into FTP Server.

Parameters:
username - The username for logging into FTP Server.

getUserName

public java.lang.String getUserName()
Method which returns the username of this UserPI.

Returns:
The username of this UserPI.

setPassword

public void setPassword(java.lang.String password)
Method to set the password for logging into FTP Server.

Parameters:
password - The password for logging into FTP Server.

getPassword

public java.lang.String getPassword()
Method which returns the password of this UserPI.

Returns:
The password of this UserPI.

isExistControlConnection

public boolean isExistControlConnection()
Method to get status of control connection.

Returns:
true, if control connection exists, false otherwise.

userPIOpenControlConnection

public boolean userPIOpenControlConnection()
Method to open the conrol connection.

Returns:
true if successfully opened control connection, false otherwise.

userPICloseControlConnection

public void userPICloseControlConnection()
Method to close conrol connection.


userPIOpenSendAsciDataConnection

public void userPIOpenSendAsciDataConnection()
Method to open data connection to send asci data.


userPIOpenReceiveAsciDataConnection

public void userPIOpenReceiveAsciDataConnection()
Method to open data connection to receive asci data.


userPIOpenSendBinaryDataConnection

public void userPIOpenSendBinaryDataConnection()
Method to open data connection to send binary data.


userPIOpenReceiveBinaryDataConnection

public void userPIOpenReceiveBinaryDataConnection()
Method to open data connection to receive binary data.


userPICloseSendAsciDataConnection

public void userPICloseSendAsciDataConnection()
Method to close data connection to send asci data.


userPICloseReceiveAsciDataConnection

public void userPICloseReceiveAsciDataConnection()
Method to close data connection to receive asci data.


userPICloseSendBinaryDataConnection

public void userPICloseSendBinaryDataConnection()
Method to close data connection to send binary data.


userPICloseReceiveBinaryDataConnection

public void userPICloseReceiveBinaryDataConnection()
Method to close data connection to receive binary data.


userPIGetServerResponse

public java.lang.String userPIGetServerResponse()
Method to get the responce from FTP Server.

Returns:
The responce from FTP Server.

userPIGetAsciData

public java.lang.String userPIGetAsciData()
Method to get the ascii data from data connection.

Returns:
The ascii data from data connection.

userPIGetBinaryData

public void userPIGetBinaryData(java.io.File file)
Method to get binary data from data connection and save it in a local file.

Parameters:
file - The local file into which to save the binary data.

userPIGetBinaryData

public void userPIGetBinaryData(java.io.File file,
                                long restartPoint)
Method to get binary data from data connection and save it in a local file. The reading starts from specified restart point.

Parameters:
file - The local file into which to save the binary data.
restartPoint - The restartPoint from which to start reading the data.

userPISendBinaryData

public void userPISendBinaryData(java.io.File file)
Method to send binary data from a local file to FTP server on data connection.

Parameters:
file - The local file from which the to read the binary data.

userPISendBinaryData

public void userPISendBinaryData(java.io.File file,
                                 long restartPoint)
Method to send binary data from a local file to FTP server on data connection. The reading starts from specified restart point.

Parameters:
file - The local file from which to read the binary data.
restartPoint - The restartPoint from which to start reading the data.

userPIGetPortParamLocalHost

public java.lang.String userPIGetPortParamLocalHost()
Method to get parameter for PORT command (32 bit IP + 16 bit TCP port) for local host.

Returns:
The port parameter string for the local host.

userPIGetPortParam

public java.lang.String userPIGetPortParam(java.lang.String host,
                                           int port)
Method to get parameter for PORT command (32 bit IP + 16 bit TCP port) for non-local host.

Parameters:
host - The hostname for which to get port parameter string.
port - The port. #return The port parameter string for the specified string.

userPICloseDataConnection

public void userPICloseDataConnection()
Method to close the data connection.


userPISendCommand

public void userPISendCommand(java.lang.String command)
Method to send the FTP command to FTP server.

Parameters:
command - The command to send to the FTP Server.

sendUSERCommand

public boolean sendUSERCommand(java.lang.String user)
Method to send USER command to FTP Server.

Parameters:
user - The command parameter.
Returns:
true if command successful, false otherwise.

sendPASSCommand

public boolean sendPASSCommand(java.lang.String pass)
Method to send PASS command to FTP Server.

Parameters:
pass - The command parameter.
Returns:
true if command successful, false otherwise.

sendACCTCommand

public void sendACCTCommand(java.lang.String accInfo)
Method to send ACCT command to FTP Server.

Parameters:
accInfo - The command parameter.

sendCWDCommand

public void sendCWDCommand(java.lang.String path)
Method to send CWD command to FTP Server.

Parameters:
path - The command parameter.

sendCDUPCommand

public void sendCDUPCommand()
Method to send CDUP command to FTP Server.


sendSMNTCommand

public void sendSMNTCommand(java.lang.String path)
Method to send SMNT command to FTP Server.

Parameters:
path - The command parameter.

sendQUITCommand

public boolean sendQUITCommand()
Method to send QUIT command to FTP Server.

Returns:
true, if command successful, false otherwise.

sendREINCommand

public void sendREINCommand()
Method to send REIN command to FTP Server.


sendPORTCommand

public void sendPORTCommand(java.lang.String hostAndPort)
Method to send PORT command to FTP Server.

Parameters:
hostAndPort - The command parameter.

sendPASVCommand

public void sendPASVCommand()
Method to send PASV command to FTP Server.


sendTYPECommand

public void sendTYPECommand(java.lang.String type)
Method to send TYPE command to FTP Server.

Parameters:
type - The command parameter.

sendSTRUCommand

public void sendSTRUCommand(java.lang.String structure)
Method to send STRU command to FTP Server.

Parameters:
structure - The command parameter.

sendMODECommand

public void sendMODECommand(java.lang.String mode)
Method to send MODE command to FTP Server.

Parameters:
mode - The command parameter.

sendRETRCommand

public void sendRETRCommand(java.lang.String remotePath,
                            java.lang.String localPath)
Method to download specified remote file as a name specified in localPath.

Parameters:
remotePath - The command parameter.
localPath - The command parameter.

sendRETRCommand

public void sendRETRCommand(java.lang.String remotePath,
                            java.lang.String localPath,
                            long restart)
Method to download specified remote file as a name specified in localPath and with resumed point.

Parameters:
remotePath - The command parameter.
localPath - The command parameter.
restart - The command parameter.

sendSTORCommand

public void sendSTORCommand(java.lang.String fileName,
                            java.lang.String path)
Method to upload the specified local file on to FTP server.

Parameters:
fileName - The command parameter.
path - The command parameter.

sendSTOUCommand

public void sendSTOUCommand(java.lang.String fileName)
Method to upload the specified local file on to FTP server with a new unique name given by server.

Parameters:
fileName - The command parameter.

sendAPPECommand

public void sendAPPECommand(java.lang.String fileName)
Method to upload the specified local file on to FTP server. if a file with same name is already exist on server, then that file will be appended, otherwise creates a new file.

Parameters:
fileName - The command parameter.

sendALLOCommand

public void sendALLOCommand(int i)
Method to send ALLO command to FTP Server.

Parameters:
i - The command parameter.

sendRESTCommand

public void sendRESTCommand(long restartPoint)
Method to send REST command to FTP Server.

Parameters:
restartPoint - The command parameter.

sendRNFRCommand

public void sendRNFRCommand(java.lang.String path)
Method to send RNFR command to FTP Server.

Parameters:
path - The command parameter.

sendRNTOCommand

public void sendRNTOCommand(java.lang.String path)
Method to send RNTO command to FTP Server.

Parameters:
path - The command parameter.

sendABORCommand

public void sendABORCommand()
Method to send ABOR command to FTP Server.


sendDELECommand

public void sendDELECommand(java.lang.String path)
Method to send DELE command to FTP Server.

Parameters:
path - The command parameter.

sendRMDCommand

public void sendRMDCommand(java.lang.String path)
Method to send RMD command to FTP Server.

Parameters:
path - The command parameter.

sendMKDCommand

public void sendMKDCommand(java.lang.String path)
Method to send MKD command to FTP Server.

Parameters:
path - The command parameter.

sendPWDCommand

public java.lang.String sendPWDCommand()
Method to send PWD command to FTP Server.

Returns:
The current path.

sendLISTCommand

public java.lang.String sendLISTCommand()
Method to send LIST command to FTP Server.

Returns:
The directory listing.

sendLISTCommand

public java.lang.String sendLISTCommand(java.lang.String path)
Method to send LIST command to FTP Server.

Parameters:
path - The command parameter.
Returns:
The directory listing.

sendNLSTCommand

public java.lang.String sendNLSTCommand()
Method to send NLST command to FTP Server.

Returns:
The directory listing.

sendNLSTCommand

public java.lang.String sendNLSTCommand(java.lang.String path)
Method to send NLST command to FTP Server.

Parameters:
path - The command parameter.
Returns:
The directory listing.

sendSITECommand

public void sendSITECommand(java.lang.String string)
Method to send SITE command to FTP Server.

Parameters:
string - The command parameter.

sendSYSTCommand

public void sendSYSTCommand()
Method to send SYST command to FTP Server.


sendSTATCommand

public void sendSTATCommand()
Method to send STAT command to FTP Server.


sendSTATCommand

public void sendSTATCommand(java.lang.String path)
Method to send STAT command to FTP Server.

Parameters:
path - The command parameter.

sendHELPCommand

public void sendHELPCommand()
Method to send HELP command to FTP Server.


sendHELPCommand

public void sendHELPCommand(java.lang.String command)
Method to send HELP command to FTP Server.

Parameters:
command - The command parameter.

sendNOOPCommand

public void sendNOOPCommand()
Method to send NOOP command to FTP Server.


getUserDTP

public UserDTP getUserDTP()
Method which returns the UserDTP for this UserPI.

Returns:
The UserDTP for this UserPI.

ElegantJCharts Java API Specification v2.0

For any feedback, suggestion, or query, please revert back to support@elegantcharts.com

Copyright(c)
Elegant Microweb Technologies Pvt. Ltd.
www.elegantmicroweb.com
www.elegantjcharts.com
All Rights Reserved.