org.objectweb.jonas_ws.wsgen.archive
Class FileArchive

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

public class FileArchive
extends AbsArchive

A FileArchive is a wrapper for directory structured as a jar.

Author:
Guillaume Sauthier

Field Summary
 
Fields inherited from class org.objectweb.jonas_ws.wsgen.archive.AbsArchive
files, i18n, manifest, root
 
Constructor Summary
FileArchive(java.io.File archive)
          Creates a new FileArchive 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

FileArchive

public FileArchive(java.io.File archive)
            throws WsGenException
Creates a new FileArchive object.

Parameters:
archive - directory structured as a jar
Throws:
WsGenException - When manifest cannot be loaded
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 corersponding to the given filename cannot be found.

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.