org.ow2.jonas.generators.genbase.archive
Class FileArchive

java.lang.Object
  extended by org.ow2.jonas.generators.genbase.archive.AbsArchive
      extended by org.ow2.jonas.generators.genbase.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

Constructor Summary
FileArchive(File archive)
          Creates a new FileArchive object.
 
Method Summary
 List getContainedFiles()
          Returns a List of all files contained in this archive.
 InputStream getInputStream(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.ow2.jonas.generators.genbase.archive.AbsArchive
addDirectory, addDirectoryIn, addFile, addFile, addFileIn, close, 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

FileArchive

public FileArchive(File archive)
            throws GenBaseException
Creates a new FileArchive object.

Parameters:
archive - directory structured as a jar
Throws:
GenBaseException - When manifest cannot be loaded
Method Detail

getInputStream

public InputStream getInputStream(String filename)
                           throws 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:
IOException - When InputStream corersponding to the given filename cannot be found.

getContainedFiles

public 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.


Copyright © 2010 OW2 Consortium. All Rights Reserved.