Class DirectoryInsideJarURLArchive

  • All Implemented Interfaces:
    Archive

    public class DirectoryInsideJarURLArchive
    extends ArchiveBase
    implements Archive
    This is an implementation of Archive which is used when container returns a jar: URL. e.g. jar:file:/tmp/a_ear/b.war!/WEB-INF/classes/
    Author:
    Sanjeeb.Sahoo@Sun.COM
    • Constructor Detail

      • DirectoryInsideJarURLArchive

        public DirectoryInsideJarURLArchive​(java.net.URL url,
                                            java.lang.String descriptorLocation)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • DirectoryInsideJarURLArchive

        public DirectoryInsideJarURLArchive​(java.net.URL url,
                                            java.lang.String descriptorLocation,
                                            java.util.logging.Logger logger)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • getEntries

        public java.util.Iterator<java.lang.String> getEntries()
        Description copied from interface: Archive
        Returns an Iterator of the file entries. Each String represents a file name relative to the root of the module.
        Specified by:
        getEntries in interface Archive
      • getEntry

        public java.io.InputStream getEntry​(java.lang.String entryPath)
                                     throws java.io.IOException
        Description copied from interface: Archive
        Returns the InputStream for the given entry name. Returns null if no such entry exists. The entry name must be relative to the root of the module.
        Specified by:
        getEntry in interface Archive
        Specified by:
        getEntry in class ArchiveBase
        Parameters:
        entryPath - the file name relative to the root of the module.
        Returns:
        the InputStream for the given entry name or null if not found.
        Throws:
        java.io.IOException
      • getEntryAsURL

        public java.net.URL getEntryAsURL​(java.lang.String entryPath)
                                   throws java.io.IOException
        Description copied from interface: Archive
        Returns the URL for the given entry name. Returns null if no such entry exists. The entry name must be relative to the root of the module.
        Specified by:
        getEntryAsURL in interface Archive
        Parameters:
        entryPath - the file name relative to the root of the module.
        Returns:
        the URL for the given entry name or null if not found.
        Throws:
        java.io.IOException
      • close

        public void close()
        Description copied from interface: Archive
        Close this archive and associated InputStream.
        Specified by:
        close in interface Archive