org.objectweb.jonas_ws.wsgen.archive
Class JarArchive

java.lang.Object
  extended byorg.objectweb.jonas_ws.wsgen.archive.AbsArchive
      extended byorg.objectweb.jonas_ws.wsgen.archive.JarArchive
All Implemented Interfaces:
Archive

public class JarArchive
extends AbsArchive

A JarArchive is a wrapper for jar file.

Author:
Guillaume Sauthier

Field Summary
 
Fields inherited from class org.objectweb.jonas_ws.wsgen.archive.AbsArchive
files, i18n, manifest, root
 
Constructor Summary
JarArchive(java.io.File jar)
          Creates a new JarArchive object.
 
Method Summary
 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.
 java.util.jar.Manifest getManifest()
          Returns the Manifest of the Archive.
 boolean isPacked()
          Returns true if archive is packed or false if archive is unpacked.
 
Methods inherited from class org.objectweb.jonas_ws.wsgen.archive.AbsArchive
addDirectory, addDirectoryIn, addFile, addFile, addFileIn, getName, getRootFile
 
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 WsGenException
Creates a new JarArchive object.

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

getManifest

public java.util.jar.Manifest getManifest()
Returns the Manifest of the Archive.

Returns:
the Manifest of the Archive.

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.