Class URL


  • public class URL
    extends java.lang.Object
    Wrapper around java.net.URL to improve usability.
    • Constructor Summary

      Constructors 
      Constructor Description
      URL​(java.lang.String spec)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.net.URL createURL​(java.lang.String spec)
      Creates java.net.URL with data protocol support.
      java.lang.Object getContent()  
      java.lang.Object getContent​(java.lang.Class<?>[] classes)  
      java.net.URLConnection openConnection()  
      • Methods inherited from class java.lang.Object

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

      • URL

        public URL​(java.lang.String spec)
            throws java.net.MalformedURLException,
                   java.net.URISyntaxException,
                   java.lang.InstantiationException,
                   java.lang.IllegalAccessException
        Throws:
        java.net.MalformedURLException
        java.net.URISyntaxException
        java.lang.InstantiationException
        java.lang.IllegalAccessException
    • Method Detail

      • createURL

        public static final java.net.URL createURL​(java.lang.String spec)
                                            throws java.net.MalformedURLException,
                                                   java.net.URISyntaxException,
                                                   java.lang.InstantiationException,
                                                   java.lang.IllegalAccessException
        Creates java.net.URL with data protocol support.
        Parameters:
        spec - the input URL as String
        Returns:
        java.net.URL instance
        Throws:
        java.net.MalformedURLException
        java.net.URISyntaxException
        java.lang.InstantiationException
        java.lang.IllegalAccessException
      • openConnection

        public java.net.URLConnection openConnection()
                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • getContent

        public java.lang.Object getContent()
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • getContent

        public java.lang.Object getContent​(java.lang.Class<?>[] classes)
                                    throws java.io.IOException
        Throws:
        java.io.IOException