Class BasicURLHandler

    • Constructor Detail

      • BasicURLHandler

        public BasicURLHandler()
    • Method Detail

      • getURLInfo

        public URLHandler.URLInfo getURLInfo​(java.net.URL url)
        Description copied from interface: URLHandler
        Returns the URLInfo of the given url or a URLHandler.UNAVAILABLE instance, if the url is not reachable.
        Parameters:
        url - The url from which information is retrieved.
        Returns:
        The URLInfo extracted from the given url, or URLHandler.UNAVAILABLE when the url is not available.
      • getURLInfo

        public URLHandler.URLInfo getURLInfo​(java.net.URL url,
                                             int timeout)
        Description copied from interface: URLHandler
        never returns null, return UNAVAILABLE when url is not reachable
        Parameters:
        url - The url from which information is retrieved.
        timeout - The timeout in milliseconds.
        Returns:
        The URLInfo extracted from the given url, or URLHandler.UNAVAILABLE when the url is not available.
      • getCharSetFromContentType

        public static java.lang.String getCharSetFromContentType​(java.lang.String contentType)
        Extract the charset from the Content-Type header string, or default to ISO-8859-1 as per rfc2616-sec3.html#sec3.7.1 .
        Parameters:
        contentType - the Content-Type header string
        Returns:
        the charset as specified in the content type, or ISO-8859-1 if unspecified.
      • openStream

        public java.io.InputStream openStream​(java.net.URL url)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • download

        public void download​(java.net.URL src,
                             java.io.File dest,
                             CopyProgressListener l)
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • upload

        public void upload​(java.io.File source,
                           java.net.URL dest,
                           CopyProgressListener l)
                    throws java.io.IOException
        Throws:
        java.io.IOException