com.application.areca.metadata.content
Class ArchiveContentAdapter

java.lang.Object
  extended by com.application.areca.metadata.AbstractMetadataAdapter
      extended by com.application.areca.metadata.content.ArchiveContentAdapter

public class ArchiveContentAdapter
extends AbstractMetadataAdapter


Author:
Olivier PETRUCCI

Areca Build ID : 7299034069467778562

Field Summary
protected  java.lang.String previousKey
           
 
Fields inherited from class com.application.areca.metadata.AbstractMetadataAdapter
DATA_CHARSET, file, isCompressed, outputStream, VERSION, VERSION_HEADER, writer, written
 
Constructor Summary
ArchiveContentAdapter(java.io.File contentFile)
           
 
Method Summary
 ContentFileIterator buildIterator()
          Build a ContentFileIterator
 ContentFileIterator buildIterator(boolean deleteOnClose)
          Build a ContentFileIterator
 AbstractMetaDataEntry decodeEntry(java.lang.String serialized)
           
static void handleFile(java.io.File file, ContentHandler contentHandler, ProcessContext context)
           
 void traverseContentFile(ContentHandler handler, ProcessContext context)
          Read the archive content file line by line and call the ContentHandler provided as argument for each line.
 void traverseContentFileNoCancel(ContentHandler handler, ProcessContext context)
          Same as traverseContentFile but ignored TaskCancelledExceptions
(useful when we know they will never be thrown)
 void writeContentEntry(FileSystemRecoveryEntry entry)
           
 void writeGenericEntry(ContentEntry entry)
           
 void writeGenericEntry(java.lang.String key, java.lang.String data)
           
 void writeHashEntry(FileSystemRecoveryEntry entry, byte[] hash)
           
 void writeSequenceEntry(FileSystemRecoveryEntry entry, HashSequence sequence)
           
 
Methods inherited from class com.application.areca.metadata.AbstractMetadataAdapter
close, getFile, getInputStream, getVersion, getVersionHeader, getWritten, initOutputStream, initWriter, isCompressed, resolveEncoding, setCompressed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

previousKey

protected java.lang.String previousKey
Constructor Detail

ArchiveContentAdapter

public ArchiveContentAdapter(java.io.File contentFile)
Method Detail

writeGenericEntry

public void writeGenericEntry(ContentEntry entry)
                       throws java.io.IOException
Throws:
java.io.IOException

writeGenericEntry

public void writeGenericEntry(java.lang.String key,
                              java.lang.String data)
                       throws java.io.IOException
Throws:
java.io.IOException

writeContentEntry

public void writeContentEntry(FileSystemRecoveryEntry entry)
                       throws java.io.IOException
Throws:
java.io.IOException

writeHashEntry

public void writeHashEntry(FileSystemRecoveryEntry entry,
                           byte[] hash)
                    throws java.io.IOException
Throws:
java.io.IOException

writeSequenceEntry

public void writeSequenceEntry(FileSystemRecoveryEntry entry,
                               HashSequence sequence)
                        throws java.io.IOException
Throws:
java.io.IOException

traverseContentFileNoCancel

public void traverseContentFileNoCancel(ContentHandler handler,
                                        ProcessContext context)
                                 throws java.io.IOException
Same as traverseContentFile but ignored TaskCancelledExceptions
(useful when we know they will never be thrown)

Throws:
java.io.IOException

decodeEntry

public AbstractMetaDataEntry decodeEntry(java.lang.String serialized)
Specified by:
decodeEntry in class AbstractMetadataAdapter

traverseContentFile

public void traverseContentFile(ContentHandler handler,
                                ProcessContext context)
                         throws java.io.IOException,
                                TaskCancelledException
Read the archive content file line by line and call the ContentHandler provided as argument for each line.

Throws:
java.io.IOException
TaskCancelledException

buildIterator

public ContentFileIterator buildIterator(boolean deleteOnClose)
                                  throws java.io.IOException
Build a ContentFileIterator

Throws:
java.io.IOException

buildIterator

public ContentFileIterator buildIterator()
                                  throws java.io.IOException
Build a ContentFileIterator

Throws:
java.io.IOException

handleFile

public static void handleFile(java.io.File file,
                              ContentHandler contentHandler,
                              ProcessContext context)
                       throws java.io.IOException,
                              ApplicationException
Throws:
java.io.IOException
ApplicationException