com.myjavaworld.ftp
Class FTPHost

java.lang.Object
  extended by com.myjavaworld.ftp.FTPHost
All Implemented Interfaces:
Serializable

public class FTPHost
extends Object
implements Serializable

A class that encapsulates the information of an FTP server. Objects of this class are used by FTPClient for connecting/login to the FTP server.

Version:
2.0
Author:
Sai Pullabhotla, psai [at] jMethods [dot] com
See Also:
Serialized Form

Constructor Summary
FTPHost()
          Constructs an FTPHost object.
FTPHost(String hostName, int port, String userName, String password, String account)
          Constructs an FTPHost object.
FTPHost(String hostName, String userName, String password)
          Constructs an FTPHost object.
FTPHost(String hostName, String userName, String password, String account)
          Constructs an FTPHost object.
 
Method Summary
 String getAccount()
          Returns the account name.
 String getHostName()
          Returns the host name
 String getPassword()
          Returns the password
 int getPort()
          Returns the port number.
 String getUserName()
          returns the user name.
 void setAccount(String account)
          Sets the account to the given account.
 void setHostName(String hostName)
          Sets the host name to the given hostName.
 void setPassword(String password)
          Sets the password to the given password.
 void setPort(int port)
          Sets the port number to the given port.
 void setUserName(String userName)
          Sets the user name to the given userName.
 String toString()
          Returns a string representation of this FTPHost.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FTPHost

public FTPHost()
Constructs an FTPHost object.


FTPHost

public FTPHost(String hostName,
               String userName,
               String password)
Constructs an FTPHost object.

Parameters:
hostName - host name or IP address
userName - user name for login
password - Password for login

FTPHost

public FTPHost(String hostName,
               String userName,
               String password,
               String account)
Constructs an FTPHost object.

Parameters:
hostName - host name or IP address
userName - user name for login
password - Password for login
account - Account name for login

FTPHost

public FTPHost(String hostName,
               int port,
               String userName,
               String password,
               String account)
Constructs an FTPHost object.

Parameters:
hostName - host name or IP address port Port number to connect to
port - Port number
userName - user name for login
password - Password for login
account - Account name for login
Method Detail

setHostName

public void setHostName(String hostName)
Sets the host name to the given hostName.

Parameters:
hostName - Host name or IP address

getHostName

public String getHostName()
Returns the host name

Returns:
Host name

setPort

public void setPort(int port)
Sets the port number to the given port.

Parameters:
port - Port number of this FTPHost.

getPort

public int getPort()
Returns the port number.

Returns:
Port number.

setUserName

public void setUserName(String userName)
Sets the user name to the given userName.

Parameters:
userName - user name for login.

getUserName

public String getUserName()
returns the user name.

Returns:
User name.

setPassword

public void setPassword(String password)
Sets the password to the given password.

Parameters:
password - Password for login.

getPassword

public String getPassword()
Returns the password

Returns:
Password.

setAccount

public void setAccount(String account)
Sets the account to the given account.

Parameters:
account - Account name for login

getAccount

public String getAccount()
Returns the account name.

Returns:
Account name.

toString

public String toString()
Returns a string representation of this FTPHost.

Overrides:
toString in class Object
Returns:
String representation.


Copyright © 2000-2012 jMethods, Inc.. All Rights Reserved.