org.icepdf.ri.util
Class URLAccess

java.lang.Object
  extended by org.icepdf.ri.util.URLAccess

public class URLAccess
extends java.lang.Object

This utility class simplifies the process of loading URLs.

Since:
1.3

Field Summary
 java.lang.String errorMessage
          The reason why the URL was invalid.
 java.io.InputStream inputStream
          Access to the data at the URL, if the URL was valid.
 java.net.URL url
          The resolved URL, if urlLocation was valid.
 java.lang.String urlLocation
          The given URL string given to doURLAccess().
 
Method Summary
 void closeConnection()
          Close the connection, but keep all the String information about the connection.
 void dispose()
          Free up any resources used, immediately.
static URLAccess doURLAccess(java.lang.String urlLocation)
          Simple utility method to check if a URL is valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

urlLocation

public java.lang.String urlLocation
The given URL string given to doURLAccess().


url

public java.net.URL url
The resolved URL, if urlLocation was valid.


inputStream

public java.io.InputStream inputStream
Access to the data at the URL, if the URL was valid.


errorMessage

public java.lang.String errorMessage
The reason why the URL was invalid.

Method Detail

doURLAccess

public static URLAccess doURLAccess(java.lang.String urlLocation)
Simple utility method to check if a URL is valid. If it is invalid, then urlAccess.errorMessage will say why. If it is valid, then urlAccess.url will be a valid URL object, and urlAccess.inputStream will be opened to access the data from the URL.

Parameters:
urlLocation -
Returns:
URLAccess urlAccess

dispose

public void dispose()
Free up any resources used, immediately.


closeConnection

public void closeConnection()
Close the connection, but keep all the String information about the connection.