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

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

public class DirectoryArchive
extends java.lang.Object
implements ArchiveAdapter

Directory base archive abstraction


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.glassfish.hk2.classmodel.reflect.ArchiveAdapter
ArchiveAdapter.Entry
 
Field Summary
 java.io.File directory
           
 java.util.List<ArchiveAdapter.Entry> entries
           
 
Constructor Summary
DirectoryArchive(java.io.File directory)
           
 
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
 

Field Detail

directory

public final java.io.File directory

entries

public final java.util.List<ArchiveAdapter.Entry> entries
Constructor Detail

DirectoryArchive

public DirectoryArchive(java.io.File directory)
Method Detail

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

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.

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.

iterator

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


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