Class URLAccess


  • public class URLAccess
    extends Object
    This utility class simplifies the process of loading URLs.
    Since:
    1.3
    • 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.