Class JarEntryResource

  • All Implemented Interfaces:
    Resource

    final class JarEntryResource
    extends java.lang.Object
    implements Resource
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.jar.JarEntry entry  
      private java.lang.String entryName  
      private java.util.jar.JarFile jarFile  
      private java.net.URL resourceURL  
    • Constructor Summary

      Constructors 
      Constructor Description
      JarEntryResource​(java.util.jar.JarFile jarFile, java.util.jar.JarEntry entry, java.lang.String relativePath, java.net.URL resourceURL)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getName()
      Get the relative resource name.
      long getSize()
      Get the size of the resource, if known.
      java.net.URL getURL()
      Get the complete URL of this resource.
      java.io.InputStream openStream()
      Open an input stream to this resource.
      • Methods inherited from class java.lang.Object

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

      • jarFile

        private final java.util.jar.JarFile jarFile
      • entry

        private final java.util.jar.JarEntry entry
      • entryName

        private final java.lang.String entryName
      • resourceURL

        private final java.net.URL resourceURL
    • Constructor Detail

      • JarEntryResource

        JarEntryResource​(java.util.jar.JarFile jarFile,
                         java.util.jar.JarEntry entry,
                         java.lang.String relativePath,
                         java.net.URL resourceURL)
    • Method Detail

      • getName

        public java.lang.String getName()
        Description copied from interface: Resource
        Get the relative resource name.
        Specified by:
        getName in interface Resource
        Returns:
        the name
      • getURL

        public java.net.URL getURL()
        Description copied from interface: Resource
        Get the complete URL of this resource.
        Specified by:
        getURL in interface Resource
        Returns:
        the URL
      • openStream

        public java.io.InputStream openStream()
                                       throws java.io.IOException
        Description copied from interface: Resource
        Open an input stream to this resource.
        Specified by:
        openStream in interface Resource
        Returns:
        the stream
        Throws:
        java.io.IOException - if an I/O error occurs
      • getSize

        public long getSize()
        Description copied from interface: Resource
        Get the size of the resource, if known.
        Specified by:
        getSize in interface Resource
        Returns:
        the size, or 0L if unknown