Class UrlFactory


  • public class UrlFactory
    extends java.lang.Object
    A factory for creating URL objects.
    Author:
    Alejandro Galue
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void disconnect​(java.net.URLConnection connection)
      Disconnect.
      static java.net.URL getUrl​(java.lang.String urlStr, Request request)
      Gets the URL Object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getUrl

        public static java.net.URL getUrl​(java.lang.String urlStr,
                                          Request request)
                                   throws java.net.MalformedURLException
        Gets the URL Object.

        This method has been created because it is not possible to call URL.setURLStreamHandlerFactory more than once.

        Parameters:
        urlStr - the URL String
        request - the request
        Returns:
        the URL Object
        Throws:
        java.net.MalformedURLException - the malformed URL exception
      • disconnect

        public static void disconnect​(java.net.URLConnection connection)
        Disconnect.
        Parameters:
        connection - the URL connection