org.apache.karaf.diagnostic.core.common
Class ZipDumpDestination

java.lang.Object
  extended by org.apache.karaf.diagnostic.core.common.ZipDumpDestination
All Implemented Interfaces:
DumpDestination

public class ZipDumpDestination
extends java.lang.Object
implements DumpDestination

Class which packages dumps to ZIP archive.

Author:
ldywicki

Constructor Summary
ZipDumpDestination(java.io.File file)
          Creates new dump in given file (zip archive).
ZipDumpDestination(java.io.File directory, java.lang.String name)
          Creates new dump in given directory.
 
Method Summary
 java.io.OutputStream add(java.lang.String name)
          Creates new entry in dump destination.
 void save()
          Closes archive handle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZipDumpDestination

public ZipDumpDestination(java.io.File directory,
                          java.lang.String name)
Creates new dump in given directory.

Parameters:
directory - Target directory.
name - Name of the archive.

ZipDumpDestination

public ZipDumpDestination(java.io.File file)
Creates new dump in given file (zip archive).

Parameters:
file - Destination file.
Method Detail

add

public java.io.OutputStream add(java.lang.String name)
                         throws Exception
Creates new entry in dump destination. Destination does not close returned output stream by default, dump provider should do this after completing write operation.

Specified by:
add in interface DumpDestination
Parameters:
name - Name of file in destination.
Returns:
Output stream ready to write.
Throws:
Exception - When entry cannot be added.

save

public void save()
          throws Exception
Closes archive handle.

Specified by:
save in interface DumpDestination
Throws:
Exception


Copyright © 2007-2011 Apache Software Foundation. All Rights Reserved.