org.objectweb.jonas_ws.wsgen.utils
Class ArchiveStorer

java.lang.Object
  extended byorg.objectweb.jonas_ws.wsgen.utils.ArchiveStorer
Direct Known Subclasses:
DirStorer, JarStorer

public abstract class ArchiveStorer
extends java.lang.Object

Store an Archive in compressed or uncompressed format

Author:
Guillaume Sauthier

Field Summary
protected  java.util.List already
          already saved filenames
protected  J2EEArchive archive
          base J2EEArchive to be saved
protected static I18n i18n
          i18n
protected static org.objectweb.util.monolog.api.Logger logger
          logger
static int MAX_BUFFER_SIZE
          Buffer Size
protected  java.lang.String out
          output filename
 
Constructor Summary
ArchiveStorer(J2EEArchive archive)
          Creates a new ArchiveStorer object.
 
Method Summary
protected abstract  void addFile(java.lang.String name)
          add a file in saved archive
protected abstract  java.lang.String convertName(java.lang.String name)
          convert a filename from unix to windows filename and reverse
protected static void fill(java.io.InputStream is, java.io.OutputStream os)
          Fill an OutputStream with content from an InputStream
protected abstract  java.io.OutputStream getOutputStream(java.lang.String name)
          Returns an OutputStream from the given name
 void store()
          Store the content of the contained archive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_BUFFER_SIZE

public static final int MAX_BUFFER_SIZE
Buffer Size

See Also:
Constant Field Values

i18n

protected static final I18n i18n
i18n


logger

protected static final org.objectweb.util.monolog.api.Logger logger
logger


archive

protected J2EEArchive archive
base J2EEArchive to be saved


already

protected java.util.List already
already saved filenames


out

protected java.lang.String out
output filename

Constructor Detail

ArchiveStorer

public ArchiveStorer(J2EEArchive archive)
Creates a new ArchiveStorer object.

Parameters:
archive - archive to be saved
Method Detail

fill

protected static void fill(java.io.InputStream is,
                           java.io.OutputStream os)
                    throws java.io.IOException
Fill an OutputStream with content from an InputStream

Parameters:
is - InputStream
os - OutputStream
Throws:
java.io.IOException - When filling fails

addFile

protected abstract void addFile(java.lang.String name)
                         throws java.io.IOException
add a file in saved archive

Parameters:
name - file name
Throws:
java.io.IOException - When save fails

convertName

protected abstract java.lang.String convertName(java.lang.String name)
convert a filename from unix to windows filename and reverse

Parameters:
name - name to be converted
Returns:
converted filename

getOutputStream

protected abstract java.io.OutputStream getOutputStream(java.lang.String name)
                                                 throws java.io.IOException
Returns an OutputStream from the given name

Parameters:
name - the filename we want to open/create
Returns:
an OutputStream from the given name
Throws:
java.io.IOException - When OS cannot be created

store

public void store()
           throws WsGenException
Store the content of the contained archive.

Throws:
WsGenException - When cannot add all files