org.objectweb.jonas_ws.wsgen.archive
Class AbsArchive

java.lang.Object
  extended byorg.objectweb.jonas_ws.wsgen.archive.AbsArchive
All Implemented Interfaces:
Archive
Direct Known Subclasses:
FileArchive, JarArchive

public abstract class AbsArchive
extends java.lang.Object
implements Archive

An AbsArchive centralized commonly used methods for Jar and File support.

Author:
Guillaume Sauthier

Field Summary
protected  java.util.Map files
          map between name and files added in the archive
protected static I18n i18n
          i18n
protected  java.util.jar.Manifest manifest
          the archive Manifest
protected  java.io.File root
          root directory of the archive
 
Constructor Summary
AbsArchive(java.io.File file)
          Create a FileArchive where the root if the given file.
 
Method Summary
 void addDirectory(java.io.File directory)
          add the content of the given directory into the root of the archive.
 void addDirectoryIn(java.lang.String dirName, java.io.File directory)
          add the content of the given directory into the given directory of the archive.
 void addFile(java.io.File file)
          add a lonely file into the root directory of the archive.
 void addFile(java.io.File file, java.lang.String name)
          add a file into the root directory of the archive with a specified name.
 void addFileIn(java.lang.String dirName, java.io.File file)
          add a lonely file into the given directory of the archive.
 java.lang.String getName()
          Returns the name of the Archive.
 java.io.File getRootFile()
          Returns the File corresponding to the root of the archive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.jonas_ws.wsgen.archive.Archive
getContainedFiles, getInputStream, getManifest, isPacked
 

Field Detail

i18n

protected static I18n i18n
i18n


root

protected java.io.File root
root directory of the archive


manifest

protected java.util.jar.Manifest manifest
the archive Manifest


files

protected java.util.Map files
map between name and files added in the archive

Constructor Detail

AbsArchive

public AbsArchive(java.io.File file)
Create a FileArchive where the root if the given file.

Parameters:
file - the directory base of the archive
Method Detail

addDirectory

public void addDirectory(java.io.File directory)
add the content of the given directory into the root of the archive.

Specified by:
addDirectory in interface Archive
Parameters:
directory - directory to add

addDirectoryIn

public void addDirectoryIn(java.lang.String dirName,
                           java.io.File directory)
add the content of the given directory into the given directory of the archive.

Specified by:
addDirectoryIn in interface Archive
Parameters:
dirName - archive directory name.
directory - directory to add.

addFile

public void addFile(java.io.File file)
add a lonely file into the root directory of the archive.

Specified by:
addFile in interface Archive
Parameters:
file - the file to be added.

addFile

public void addFile(java.io.File file,
                    java.lang.String name)
add a file into the root directory of the archive with a specified name.

Specified by:
addFile in interface Archive
Parameters:
file - the file to be added.
name - filename

addFileIn

public void addFileIn(java.lang.String dirName,
                      java.io.File file)
add a lonely file into the given directory of the archive.

Specified by:
addFileIn in interface Archive
Parameters:
dirName - archive directory name.
file - the file to be added.

getRootFile

public java.io.File getRootFile()
Returns the File corresponding to the root of the archive.

Specified by:
getRootFile in interface Archive
Returns:
the File corresponding to the root of the archive.

getName

public java.lang.String getName()
Returns the name of the Archive.

Specified by:
getName in interface Archive
Returns:
the name of the Archive.