- java.lang.Object
-
- org.icepdf.ri.util.URLAccess
-
public class URLAccess extends Object
This utility class simplifies the process of loading URLs.- Since:
- 1.3
-
-
Field Summary
Fields Modifier and Type Field Description StringerrorMessageThe reason why the URL was invalid.InputStreaminputStreamAccess to the data at the URL, if the URL was valid.URLurlThe resolved URL, if urlLocation was valid.StringurlLocationThe given URL string given to doURLAccess().
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseConnection()Close the connection, but keep all the String information about the connection.voiddispose()Free up any resources used, immediately.static URLAccessdoURLAccess(String urlLocation)Simple utility method to check if a URL is valid.
-
-
-
Field Detail
-
urlLocation
public String urlLocation
The given URL string given to doURLAccess().
-
url
public URL url
The resolved URL, if urlLocation was valid.
-
inputStream
public InputStream inputStream
Access to the data at the URL, if the URL was valid.
-
errorMessage
public String errorMessage
The reason why the URL was invalid.
-
-
Method Detail
-
doURLAccess
public static URLAccess doURLAccess(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- url to check- Returns:
- URLAccess urlAccess access result
-
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.
-
-