org.ejtools.archive.io
Class StreamWriter

java.lang.Object
  |
  +--org.ejtools.archive.io.StreamWriter
All Implemented Interfaces:
Writer
Direct Known Subclasses:
FileWriter

public abstract class StreamWriter
extends java.lang.Object
implements Writer

Writer implementation based on stream. Each Archive and each Entry will be output through a ZipOutputStream. This classe serves as parent for derived ones.

Version:
$Revision: 1.2 $
Author:
Laurent Etiemble

Constructor Summary
StreamWriter()
           
 
Method Summary
protected  java.util.zip.ZipOutputStream getZipOutputStream()
          Returns the current stream
protected  java.util.zip.ZipOutputStream popZipOutputStream()
          Pops the last entered stream
protected  void pushZipOutputStream(java.util.zip.ZipOutputStream stream)
          Pushes a stream onto the stack
 void visit(Archive archive)
          Visit an archive.
 void visit(Entry entry)
          Visit an entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamWriter

public StreamWriter()
Method Detail

visit

public void visit(Archive archive)
Visit an archive. A new ZipOutputStream is created for each Archive.

Specified by:
visit in interface Writer
Parameters:
archive - The archive to visit

visit

public void visit(Entry entry)
Visit an entry.

Specified by:
visit in interface Writer
Parameters:
entry - The entry to visit

getZipOutputStream

protected java.util.zip.ZipOutputStream getZipOutputStream()
Returns the current stream

Returns:
The current stream

popZipOutputStream

protected java.util.zip.ZipOutputStream popZipOutputStream()
                                                    throws java.io.IOException
Pops the last entered stream

Returns:
The stream
Throws:
java.io.IOException - If no stream is available

pushZipOutputStream

protected void pushZipOutputStream(java.util.zip.ZipOutputStream stream)
                            throws java.io.IOException
Pushes a stream onto the stack

Parameters:
stream - The stream
Throws:
java.io.IOException - Shoud never occured


Copyright © 2002-2003 EJTools Org.. All Rights Reserved.