org.jutil
Class TNet

java.lang.Object
  extended by org.jutil.TNet

public final class TNet
extends java.lang.Object

This is the TNet utility code class.


Constructor Summary
TNet()
          Ensure that no one can create instances of this Class.
 
Method Summary
static boolean checkConnection(java.net.URL url)
           
static boolean checkConnection(java.net.URL url, boolean debug)
           
static void dumpURLToFile(java.net.URL url, java.io.File file)
           
static java.net.InetAddress getInetAddress()
           
static void main(java.lang.String[] args)
          java org.jutil.TNet dumpURL "http://www.coolcat.com.au/" dump0.html
static java.lang.StringBuffer post(Post post)
          org.jutil.TNet.post(org.jutil.net.Post);
static java.lang.StringBuffer post(java.net.URL url, java.lang.StringBuffer data)
          org.jutil.TNet.post(URL url, StringBuffer data);
URL url = new URL("http://myHost.com/servlet/myServlet");
StringBuffer postData = new StringBuffer();
postData.append("parm0=");
postData.append(URLEncoder.encode("parm0-value"));
postData.append("&");
postData.append("parm1=");
postData.append(URLEncoder.encode("parm1-value"));
postData.append("&");
postData.append("parm2=");
postData.append(URLEncoder.encode("parm2-value"));
StringBuffer result = TNet.post(url, data);
static java.lang.StringBuffer post(java.net.URL url, java.lang.StringBuffer data, java.lang.String contentType)
           
static java.lang.Object readPostObject(Post post)
           
static URLContent readPostURLContent(java.net.URL url, java.lang.StringBuffer data)
           
static URLContent readPostURLContent(java.net.URL url, java.lang.StringBuffer data, java.lang.String contentType)
           
static java.lang.StringBuffer readURL(java.net.URL url)
           
static URLContent readURLContent(java.net.URL url)
           
static java.lang.Object readURLObject(java.net.URL url)
           
static java.lang.String[] readURLToArray(java.net.URL url)
           
static java.lang.Object writeObject(java.net.URL url, java.io.Serializable value)
           
static java.lang.Object writeObject(java.net.URL url, java.io.Serializable value, java.lang.String contentType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TNet

public TNet()
Ensure that no one can create instances of this Class.

Method Detail

getInetAddress

public static final java.net.InetAddress getInetAddress()

main

public static void main(java.lang.String[] args)
java org.jutil.TNet dumpURL "http://www.coolcat.com.au/" dump0.html


dumpURLToFile

public static final void dumpURLToFile(java.net.URL url,
                                       java.io.File file)
                                throws java.net.MalformedURLException,
                                       java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

readURLToArray

public static final java.lang.String[] readURLToArray(java.net.URL url)
                                               throws java.net.MalformedURLException,
                                                      java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

readURL

public static final java.lang.StringBuffer readURL(java.net.URL url)
                                            throws java.net.MalformedURLException,
                                                   java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

readURLObject

public static final java.lang.Object readURLObject(java.net.URL url)
                                            throws java.net.MalformedURLException,
                                                   java.io.IOException,
                                                   java.io.OptionalDataException,
                                                   java.lang.ClassNotFoundException
Throws:
java.net.MalformedURLException
java.io.IOException
java.io.OptionalDataException
java.lang.ClassNotFoundException

readURLContent

public static final URLContent readURLContent(java.net.URL url)
                                       throws java.net.MalformedURLException,
                                              java.io.IOException,
                                              java.io.OptionalDataException,
                                              java.lang.ClassNotFoundException
Throws:
java.net.MalformedURLException
java.io.IOException
java.io.OptionalDataException
java.lang.ClassNotFoundException

readPostURLContent

public static final URLContent readPostURLContent(java.net.URL url,
                                                  java.lang.StringBuffer data)
                                           throws java.io.IOException,
                                                  java.net.MalformedURLException,
                                                  java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.net.MalformedURLException
java.lang.ClassNotFoundException

readPostURLContent

public static final URLContent readPostURLContent(java.net.URL url,
                                                  java.lang.StringBuffer data,
                                                  java.lang.String contentType)
                                           throws java.io.IOException,
                                                  java.net.MalformedURLException,
                                                  java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.net.MalformedURLException
java.lang.ClassNotFoundException

readPostObject

public static final java.lang.Object readPostObject(Post post)
                                             throws java.net.MalformedURLException,
                                                    java.io.OptionalDataException,
                                                    java.io.IOException,
                                                    java.lang.ClassNotFoundException
Throws:
java.net.MalformedURLException
java.io.OptionalDataException
java.io.IOException
java.lang.ClassNotFoundException

post

public static final java.lang.StringBuffer post(java.net.URL url,
                                                java.lang.StringBuffer data)
                                         throws java.io.IOException,
                                                java.net.MalformedURLException
org.jutil.TNet.post(URL url, StringBuffer data);
URL url = new URL("http://myHost.com/servlet/myServlet");
StringBuffer postData = new StringBuffer();
postData.append("parm0=");
postData.append(URLEncoder.encode("parm0-value"));
postData.append("&");
postData.append("parm1=");
postData.append(URLEncoder.encode("parm1-value"));
postData.append("&");
postData.append("parm2=");
postData.append(URLEncoder.encode("parm2-value"));
StringBuffer result = TNet.post(url, data);

Throws:
java.io.IOException
java.net.MalformedURLException

post

public static final java.lang.StringBuffer post(java.net.URL url,
                                                java.lang.StringBuffer data,
                                                java.lang.String contentType)
                                         throws java.io.IOException,
                                                java.net.MalformedURLException
Throws:
java.io.IOException
java.net.MalformedURLException

post

public static final java.lang.StringBuffer post(Post post)
                                         throws java.io.IOException,
                                                java.net.MalformedURLException
org.jutil.TNet.post(org.jutil.net.Post);

Throws:
java.io.IOException
java.net.MalformedURLException

writeObject

public static final java.lang.Object writeObject(java.net.URL url,
                                                 java.io.Serializable value)
                                          throws java.io.IOException,
                                                 java.net.MalformedURLException,
                                                 java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.net.MalformedURLException
java.lang.ClassNotFoundException

writeObject

public static final java.lang.Object writeObject(java.net.URL url,
                                                 java.io.Serializable value,
                                                 java.lang.String contentType)
                                          throws java.io.IOException,
                                                 java.net.MalformedURLException,
                                                 java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.net.MalformedURLException
java.lang.ClassNotFoundException

checkConnection

public static final boolean checkConnection(java.net.URL url)
                                     throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

checkConnection

public static final boolean checkConnection(java.net.URL url,
                                            boolean debug)
                                     throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException