org.glassfish.hk2.classmodel.reflect.util
Class JarArchive

java.lang.Object
  extended by org.glassfish.hk2.classmodel.reflect.util.JarArchive
All Implemented Interfaces:
java.lang.Iterable<ArchiveAdapter.Entry>, ArchiveAdapter

public class JarArchive
extends java.lang.Object
implements ArchiveAdapter

Jar based archive abstraction


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.glassfish.hk2.classmodel.reflect.ArchiveAdapter
ArchiveAdapter.Entry
 
Constructor Summary
JarArchive(java.util.jar.JarFile jar)
           
 
Method Summary
 java.io.InputStream getInputStream(java.lang.String entry)
          Returns an input stream to read the content of the archive entry
 java.util.jar.Manifest getManifest()
          Returns the manifest instance for the archive.
 java.lang.String getName()
          Returns the name of the archive
 java.util.Iterator<ArchiveAdapter.Entry> iterator()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JarArchive

public JarArchive(java.util.jar.JarFile jar)
Method Detail

getInputStream

public java.io.InputStream getInputStream(java.lang.String entry)
                                   throws java.io.IOException
Description copied from interface: ArchiveAdapter
Returns an input stream to read the content of the archive entry

Specified by:
getInputStream in interface ArchiveAdapter
Parameters:
entry - name of the entry to read from
Returns:
InputStream instance to read the entry content from
Throws:
java.io.IOException - when the InputStream instance cannot be created.

getName

public java.lang.String getName()
Description copied from interface: ArchiveAdapter
Returns the name of the archive

Specified by:
getName in interface ArchiveAdapter
Returns:
name of the archive

iterator

public java.util.Iterator<ArchiveAdapter.Entry> iterator()
Specified by:
iterator in interface java.lang.Iterable<ArchiveAdapter.Entry>

getManifest

public java.util.jar.Manifest getManifest()
                                   throws java.io.IOException
Description copied from interface: ArchiveAdapter
Returns the manifest instance for the archive.

Specified by:
getManifest in interface ArchiveAdapter
Returns:
the archive's manifest
Throws:
java.io.IOException - if the manifest cannot be loaded.


Copyright © 2010 Sun Microsystems, Inc.. All Rights Reserved.