Class powersoft.jcm.net.Internet
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class powersoft.jcm.net.Internet

java.lang.Object
   |
   +----powersoft.jcm.net.Internet

public class Internet
extends Object
Internet class is a base class to all internet components. This class can also be instanciated.

Notes: Internet class is not drived from any component. Other classes FTP and HTTP are drived from this class.


Constructor Index

 o Internet()
Instanciate this class.

Method Index

 o close()
Close a URL.
 o closeURL()
Closes a URL.
 o CrackURL(URL)
Split the specified URL into its components.
 o CreateURL(String, String, int, String, String)
Creates a String with the supplied parameters that can be use to create an actual URL.
 o getFile()
Gets the file name.
 o getInputStream()
Gets the input stream.
 o getProtocolName()
Gets the protocol name
 o getRef()
Gets the reference.
 o getServerName()
Gets the serve name
 o getServerPort()
Gets the server port.
 o getURL()
Gets the URL.
 o getURLConnection()
Gets the URLConnection.
 o getUserName()
Gets the user name.
 o getUserPassword()
Gets the user password.
 o open()
Opens a URL.
 o openURL()
Opens a URL.
 o queryDataAvailable()
Determines the size of the opened resource.
 o readFile(byte[])
Fills the specified buffer (array of bytes) with the data read from the input stream.
 o readFile(byte[], InputStream)
Fills the specified buffer (array of bytes) with the data read from the specified input stream.
 o setFile(String)
Sets the file name.
 o setProtocolName(String)
Sets the protocol name
 o setRef(String)
Sets the reference.
 o setServerName(String)
Sets the server name.
 o setServerPort(int)
Sets the server port.
 o setUserName(String)
Sets the user name.
 o setUserPassword(String)
Sets the user password.

Constructors

 o Internet
  public Internet()
Instanciate this class.

Methods

 o getProtocolName
  public String getProtocolName()
Gets the protocol name
 o setProtocolName
  public void setProtocolName(String protocol)
Sets the protocol name
Parameters:
protocol - String containing the protocol name
 o getServerName
  public String getServerName()
Gets the serve name
 o setServerName
  public void setServerName(String host)
Sets the server name.
Parameters:
host - String containing the server name.
 o getServerPort
  public int getServerPort()
Gets the server port.
 o setServerPort
  public void setServerPort(int port)
Sets the server port.
Parameters:
port - The port number.
 o getFile
  public String getFile()
Gets the file name.
 o setFile
  public void setFile(String file)
Sets the file name.
Parameters:
file - String containing the file name.
 o getRef
  public String getRef()
Gets the reference.
 o setRef
  public void setRef(String ref)
Sets the reference.
Parameters:
ref - String containing the reference.
 o getURL
  public URL getURL()
Gets the URL.
 o getURLConnection
  public URLConnection getURLConnection()
Gets the URLConnection.
 o getInputStream
  public InputStream getInputStream()
Gets the input stream.
 o getUserName
  public String getUserName()
Gets the user name.
 o setUserName
  public void setUserName(String userName)
Sets the user name.
Parameters:
userName - String containing the user name.
 o getUserPassword
  public String getUserPassword()
Gets the user password.
 o setUserPassword
  public void setUserPassword(String userPassword)
Sets the user password.
Parameters:
userPassword - String containing the user password.
 o open
  public boolean open()
Opens a URL.
 o openURL
  public boolean openURL()
Opens a URL.
 o close
  public void close()
Close a URL.
 o closeURL
  public void closeURL()
Closes a URL.
 o queryDataAvailable
  public int queryDataAvailable()
Determines the size of the opened resource.
 o readFile
  public int readFile(byte buffer[])
Fills the specified buffer (array of bytes) with the data read from the input stream.

Notes: Internally this routine calls readFile( byte[], InputStream ).

Parameters:
buffer - An array of bytes.
Returns:
The number of bytes read from the input stream; or -1 if eof is encountered.
 o readFile
  public int readFile(byte buffer[],
                      InputStream inputStream)
Fills the specified buffer (array of bytes) with the data read from the specified input stream.
Parameters:
buffer - An array of bytes.
inputStream - An InputStream to read the data from.
Returns:
The number of bytes read from the input stream; or -1 if eof is encountered.
 o CrackURL
  public static URLComponents CrackURL(URL url)
Split the specified URL into its components.
Parameters:
url - URL instance.
Returns:
A URLComponent object containing the components of url.
 o CreateURL
  public static String CreateURL(String protocol,
                                 String host,
                                 int port,
                                 String file,
                                 String ref)
Creates a String with the supplied parameters that can be use to create an actual URL.
Parameters:
protocol - String containing the protocol name.
host - String containing the host name.
port - The port number.
file - String containing the file name.
ref - String containing the reference.

All Packages  Class Hierarchy  This Package  Previous  Next  Index