Class URLResource

  • All Implemented Interfaces:
    Resource, java.io.Closeable, java.lang.AutoCloseable

    class URLResource
    extends java.lang.Object
    implements Resource
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) static class  URLResource.JarURLUtil
      Use JarURLConnection to parse jar: URL into URL to jar URL and entry.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.nio.ByteBuffer buffer  
      private HttpClient client  
      private static java.nio.ByteBuffer CLOSED  
      private java.lang.String extra  
      private long lastModified  
      private int size  
      private java.net.URL url  
    • Field Detail

      • CLOSED

        private static final java.nio.ByteBuffer CLOSED
      • buffer

        private java.nio.ByteBuffer buffer
      • url

        private final java.net.URL url
      • extra

        private java.lang.String extra
      • lastModified

        private long lastModified
      • size

        private int size
    • Method Detail

      • buffer

        public java.nio.ByteBuffer buffer()
                                   throws java.lang.Exception
        Specified by:
        buffer in interface Resource
        Throws:
        java.lang.Exception
      • getBuffer

        private java.nio.ByteBuffer getBuffer()
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • open

        private java.io.InputStream open()
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • openInputStream

        public java.io.InputStream openInputStream()
                                            throws java.lang.Exception
        Specified by:
        openInputStream in interface Resource
        Throws:
        java.lang.Exception
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • write

        public void write​(java.io.OutputStream out)
                   throws java.lang.Exception
        Specified by:
        write in interface Resource
        Throws:
        java.lang.Exception
      • getExtra

        public java.lang.String getExtra()
        Description copied from interface: Resource
        Use Resource.decodeExtra(String) to properly decode the ZIP extra field structured binary data from the returned String.
        Specified by:
        getExtra in interface Resource
        Returns:
        A String encoding the ZIP extra field.
      • setExtra

        public void setExtra​(java.lang.String extra)
        Description copied from interface: Resource
        Use Resource.encodeExtra(byte[]) to properly encode the ZIP extra field structured binary data into the specified String.
        Specified by:
        setExtra in interface Resource
        Parameters:
        extra - A String encoding the ZIP extra field.
      • size

        public long size()
                  throws java.lang.Exception
        Specified by:
        size in interface Resource
        Throws:
        java.lang.Exception
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException