|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--uk.org.ogsadai.common.NetUtilities
Contains helper methods relating to the java.net package, such as methods to read data from URLs.
| Constructor Summary | |
NetUtilities()
|
|
| Method Summary | |
static org.w3c.dom.Document |
readToDocument(java.lang.String url,
boolean validate)
Returns a Document containing the XML data read from a
specified URL String. |
static java.lang.String |
readToString(java.lang.String url)
Returns a String containing the data read from a specified
URL String. |
static java.lang.String |
readToString(java.net.URL url)
Returns a String containing the data read from a specified
URL. |
static boolean |
sameFile(java.net.URL url1,
java.net.URL url2)
Returns true if both URLs point to the same file, otherwise returns false. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public NetUtilities()
| Method Detail |
public static org.w3c.dom.Document readToDocument(java.lang.String url,
boolean validate)
throws CommonUserException
Document containing the XML data read from a
specified URL String. Note that special care is needed
when expressing file URLs. The following forms are acceptable:
file:/C:/hello.txt or file:///C:/hello.txt
but not file://C:/hello.txt.
url - the URL String to read data fromvalidate - indicates whether or not to perform schema validation when
parsing the data and creating the document
Document containing the data read from the URL
CommonUserException - if there is a problem reading data from the specified URL
or constructing the document
public static java.lang.String readToString(java.lang.String url)
throws CommonUserException
String containing the data read from a specified
URL String. Note that special care is needed when expressing
file URLs. The following forms are acceptable:
file:/C:/hello.txt or file:///C:/hello.txt
but not file://C:/hello.txt.
url - the URL String to read data from
String containing the data read from the URL
CommonUserException - if there is a problem reading data from the specified URL
public static java.lang.String readToString(java.net.URL url)
throws CommonUserException
String containing the data read from a specified
URL.
url - the URL to read data from
String containing the data read from the URL
CommonUserException - if there is a problem reading data from the specified URL
public static boolean sameFile(java.net.URL url1,
java.net.URL url2)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||