org.objectweb.jonas_lib.genbase.archive
Class JarArchive

java.lang.Object
  extended by org.objectweb.jonas_lib.genbase.archive.AbsArchive
      extended by org.objectweb.jonas_lib.genbase.archive.JarArchive
All Implemented Interfaces:
Archive

public class JarArchive
extends AbsArchive

A JarArchive is a wrapper for jar file.

Author:
Guillaume Sauthier

Constructor Summary
JarArchive(java.io.File jar)
          Creates a new JarArchive object.
 
Method Summary
 void close()
          Close this archive
 java.util.List getContainedFiles()
          Returns a List of all files contained in this archive.
 java.io.InputStream getInputStream(java.lang.String filename)
          Returns an InputStream corresponding to the given filename.
 boolean isPacked()
          Returns true if archive is packed or false if archive is unpacked.
 
Methods inherited from class org.objectweb.jonas_lib.genbase.archive.AbsArchive
addDirectory, addDirectoryIn, addFile, addFile, addFileIn, getFiles, getI18n, getManifest, getName, getRootFile, setManifest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JarArchive

public JarArchive(java.io.File jar)
           throws GenBaseException
Creates a new JarArchive object.

Parameters:
jar - the File corresponding to a JarFile
Throws:
GenBaseException - When Manifest cannot be found
Method Detail

getInputStream

public java.io.InputStream getInputStream(java.lang.String filename)
                                   throws java.io.IOException
Returns an InputStream corresponding to the given filename.

Parameters:
filename - file name source of the InputStream
Returns:
the InputStream corresponding to the given filename.
Throws:
java.io.IOException - when InputStream of the filename cannot be found in the archive

getContainedFiles

public java.util.List getContainedFiles()
Returns a List of all files contained in this archive. Original files in jar, added Files are all included as String in this Enumeration.

Returns:
a List of all files contained in this archive.

isPacked

public boolean isPacked()
Returns true if archive is packed or false if archive is unpacked.

Returns:
true if archive is packed or false if archive is unpacked.

close

public void close()
Close this archive

Specified by:
close in interface Archive
Overrides:
close in class AbsArchive