Class URLClassPath.LocalArchiveEntry

  • All Implemented Interfaces:
    URLClassPath.Entry, java.lang.AutoCloseable
    Enclosing class:
    URLClassPath

    private static class URLClassPath.LocalArchiveEntry
    extends java.lang.Object
    implements URLClassPath.Entry
    Classpath entry class to load files from a zip/jar file in the local filesystem.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.zip.ZipFile zipFile  
    • Constructor Summary

      Constructors 
      Constructor Description
      LocalArchiveEntry​(java.lang.String fileName)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Close the underlying resource.
      java.lang.String getURL()
      Get filename or URL as string.
      java.io.InputStream openStream​(java.lang.String resourceName)
      Open an input stream to read a resource in the codebase described by this classpath entry.
      • Methods inherited from class java.lang.Object

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

      • zipFile

        private java.util.zip.ZipFile zipFile
    • Constructor Detail

      • LocalArchiveEntry

        public LocalArchiveEntry​(java.lang.String fileName)
                          throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • openStream

        public java.io.InputStream openStream​(java.lang.String resourceName)
                                       throws java.io.IOException
        Description copied from interface: URLClassPath.Entry
        Open an input stream to read a resource in the codebase described by this classpath entry.
        Specified by:
        openStream in interface URLClassPath.Entry
        Parameters:
        resourceName - name of resource to load: e.g., "java/lang/Object.class"
        Returns:
        an InputStream, or null if the resource wasn't found
        Throws:
        java.io.IOException - if an I/O error occurs
      • close

        public void close()
        Description copied from interface: URLClassPath.Entry
        Close the underlying resource.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface URLClassPath.Entry