sam.core
Class Storer

java.lang.Object
  |
  +--sam.rules.ModusOperandi.Opus
        |
        +--sam.core.Storer

public abstract class Storer
extends ModusOperandi.Opus

General-purpose class implementing the storing procedure.


Field Summary
 
Fields inherited from class sam.rules.ModusOperandi.Opus
name
 
Constructor Summary
protected Storer(java.lang.String name)
           
 
Method Summary
protected  void close(java.io.OutputStream output, sam.io.Packer packer, sam.io.CloseAvoiderOutputStream filtered)
          Closes the archive entry.
protected  java.util.jar.JarOutputStream createArchive(java.io.File archive)
          Creates the archive.
protected  java.io.OutputStream open(sam.rules.ModusOperandi modusOperandi, java.util.jar.JarOutputStream archive)
          Opens an entry of the archive to write plain data into.
protected  java.util.jar.JarOutputStream process(sam.rules.ModusOperandi modusOperandi)
           
protected  void store(sam.entry.Enumerator files, java.io.OutputStream output, sam.event.EventNotifier eventNotifier)
          Stores specified files
protected abstract  void storeEntry(java.io.InputStream source, java.io.OutputStream archive, sam.entry.Entry entry)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Storer

protected Storer(java.lang.String name)
Method Detail

process

protected java.util.jar.JarOutputStream process(sam.rules.ModusOperandi modusOperandi)
Specified by:
process in class ModusOperandi.Opus

createArchive

protected java.util.jar.JarOutputStream createArchive(java.io.File archive)
Creates the archive.

Parameters:
archive - the archive file to be created of overwritten.

open

protected java.io.OutputStream open(sam.rules.ModusOperandi modusOperandi,
                                    java.util.jar.JarOutputStream archive)
                             throws java.io.IOException
Opens an entry of the archive to write plain data into. This includes properly ciphering and packing data, and all this possibly in among pultiple threads.

WARNING: the returned OutputStream must be closed before any subsequent write to the archive, in order for the JarEntry to be properly closed.

java.io.IOException

close

protected void close(java.io.OutputStream output,
                     sam.io.Packer packer,
                     sam.io.CloseAvoiderOutputStream filtered)
              throws java.io.IOException
Closes the archive entry.

Parameters:
output - the entry OutputStream
filtered - the intermediate filtered stream
java.io.IOException

store

protected void store(sam.entry.Enumerator files,
                     java.io.OutputStream output,
                     sam.event.EventNotifier eventNotifier)
              throws java.io.IOException
Stores specified files

Returns:
the actual files catalogthe mixing trace
java.io.IOException

storeEntry

protected abstract void storeEntry(java.io.InputStream source,
                                   java.io.OutputStream archive,
                                   sam.entry.Entry entry)
                            throws java.io.IOException
java.io.IOException