org.objectweb.jonas_lib.genbase.utils
Class DirStorer

java.lang.Object
  extended by org.objectweb.jonas_lib.genbase.utils.ArchiveStorer
      extended by org.objectweb.jonas_lib.genbase.utils.DirStorer

public class DirStorer
extends ArchiveStorer

Store a J2EEArchive in an unpacked form.

Author:
Guillaume Sauthier

Field Summary
 
Fields inherited from class org.objectweb.jonas_lib.genbase.utils.ArchiveStorer
MAX_BUFFER_SIZE
 
Constructor Summary
DirStorer(J2EEArchive archive, java.io.File dir)
          Creates a new DirStorer object.
 
Method Summary
protected  void addFile(java.lang.String name)
          add a given file in the filesystem.
protected  java.lang.String convertName(java.lang.String name)
          Convert a filename to a local filesystem filename.
protected  java.io.OutputStream getOutputStream(java.lang.String name)
          returns the OuputStream corresponding to the given filename.
 
Methods inherited from class org.objectweb.jonas_lib.genbase.utils.ArchiveStorer
fill, getArchive, getI18n, setOut, store
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirStorer

public DirStorer(J2EEArchive archive,
                 java.io.File dir)
          throws GenBaseException
Creates a new DirStorer object.

Parameters:
archive - archive to be stored
dir - output directory
Throws:
GenBaseException - if cannot create output directory
Method Detail

convertName

protected java.lang.String convertName(java.lang.String name)
Convert a filename to a local filesystem filename.

Specified by:
convertName in class ArchiveStorer
Parameters:
name - name to be converted
Returns:
converted filename

addFile

protected void addFile(java.lang.String name)
                throws java.io.IOException
add a given file in the filesystem.

Specified by:
addFile in class ArchiveStorer
Parameters:
name - filename
Throws:
java.io.IOException - When fill fails.

getOutputStream

protected java.io.OutputStream getOutputStream(java.lang.String name)
                                        throws java.io.IOException
returns the OuputStream corresponding to the given filename.

Specified by:
getOutputStream in class ArchiveStorer
Parameters:
name - filename to create
Returns:
An OutputStream
Throws:
java.io.IOException - When file creation fails.