Class Handler


  • public class Handler
    extends java.net.URLStreamHandler
    A stream protocol handler for the data: protocol as specified in RFC 2397.
    • Constructor Summary

      Constructors 
      Constructor Description
      Handler()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static java.nio.charset.Charset getCharset​(MediaType mediaType)  
      private byte[] getData​(java.lang.String spec, int indexOfComma, int limit, MediaType mediaType, boolean base64Data)  
      private MediaType getMediaType​(java.lang.String spec, int start, int indexOfComma)  
      private boolean isBase64Data​(java.lang.String spec, int indexOfComma)  
      protected DataURLConnection openConnection​(java.net.URL u)
      protected DataURLConnection openConnection​(java.net.URL u, java.net.Proxy p)
      protected void parseURL​(java.net.URL u, java.lang.String spec, int start, int limit)
      private int validateCommaPresent​(java.lang.String spec, int start, int limit)  
      private void validateProtocol​(java.net.URL u)  
      • Methods inherited from class java.net.URLStreamHandler

        equals, getDefaultPort, getHostAddress, hashCode, hostsEqual, sameFile, setURL, setURL, toExternalForm
      • Methods inherited from class java.lang.Object

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

      • PROTOCOL

        public static final java.lang.String PROTOCOL
        The protocol name.
        See Also:
        Constant Field Values
      • BASE64_POSTFIX_LENGTH

        private static final int BASE64_POSTFIX_LENGTH
    • Constructor Detail

      • Handler

        public Handler()
    • Method Detail

      • openConnection

        protected DataURLConnection openConnection​(java.net.URL u)
        Specified by:
        openConnection in class java.net.URLStreamHandler
      • openConnection

        protected DataURLConnection openConnection​(java.net.URL u,
                                                   java.net.Proxy p)
        Overrides:
        openConnection in class java.net.URLStreamHandler
      • parseURL

        protected void parseURL​(java.net.URL u,
                                java.lang.String spec,
                                int start,
                                int limit)
        Overrides:
        parseURL in class java.net.URLStreamHandler
      • validateProtocol

        private void validateProtocol​(java.net.URL u)
      • validateCommaPresent

        private int validateCommaPresent​(java.lang.String spec,
                                         int start,
                                         int limit)
      • getMediaType

        private MediaType getMediaType​(java.lang.String spec,
                                       int start,
                                       int indexOfComma)
      • isBase64Data

        private boolean isBase64Data​(java.lang.String spec,
                                     int indexOfComma)
      • getData

        private byte[] getData​(java.lang.String spec,
                               int indexOfComma,
                               int limit,
                               MediaType mediaType,
                               boolean base64Data)
      • getCharset

        static java.nio.charset.Charset getCharset​(MediaType mediaType)