org.at4j.util.archive
Class ExtractSpecification

java.lang.Object
  extended by org.at4j.util.archive.ExtractSpecification

public class ExtractSpecification
extends Object

This specification object contains configuration for an extraction operation by the ArchiveExtractor.

When this object is instantiated, it contains the default extraction settings:

Since:
1.0
Author:
Karl Gustafsson

Constructor Summary
ExtractSpecification()
           
 
Method Summary
 EntryExtractionStrategy getEntryExtractionStrategy()
          Get the strategy object for extracting entries.
 Filter<? super ArchiveEntry<?,?>> getFilter()
          Get the filter for the extraction operation.
 OverwriteStrategy getOverwriteStrategy()
           
 ExtractSpecification setEntryExtractionStrategy(EntryExtractionStrategy entryExtractor)
          Set the strategy object for extracting entries.
 ExtractSpecification setFilter(Filter<? super ArchiveEntry<?,?>> filter)
          Set the filter that archive entries must match in order to be extracted.
 ExtractSpecification setOverwriteStrategy(OverwriteStrategy strat)
          If an entity already exists in a location where the extractor tries to extract an entry, should the old entry be overwritten? Should a warning be printed?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtractSpecification

public ExtractSpecification()
Method Detail

getFilter

public Filter<? super ArchiveEntry<?,?>> getFilter()
Get the filter for the extraction operation.

Returns:
Get the filter, or null if no filter is set.

setFilter

public ExtractSpecification setFilter(Filter<? super ArchiveEntry<?,?>> filter)
Set the filter that archive entries must match in order to be extracted. This filter is evaluated against all entries in the archive. If an entry, but not its parent directory, matches the filter, the parent directory is created at the target anyway. Archive entry filters often implement the marker interface

Parameters:
filter - The filter, or null if all entries should be extracted.
Returns:
this

getEntryExtractionStrategy

public EntryExtractionStrategy getEntryExtractionStrategy()
Get the strategy object for extracting entries.

Returns:
The strategy object for extracting entries.

setEntryExtractionStrategy

public ExtractSpecification setEntryExtractionStrategy(EntryExtractionStrategy entryExtractor)
Set the strategy object for extracting entries. This will be called with all entries that match the filter (if any).

Parameters:
entryExtractor - The entry extraction strategy.
Returns:
this

setOverwriteStrategy

public ExtractSpecification setOverwriteStrategy(OverwriteStrategy strat)
If an entity already exists in a location where the extractor tries to extract an entry, should the old entry be overwritten? Should a warning be printed?

Non-empty directories cannot be overwritten. If the archive extractor encounters a non-empty directory, it throws an DirectoryNotEmptyException.

Parameters:
strat - The overwrite strategy to use.
Returns:
this

getOverwriteStrategy

public OverwriteStrategy getOverwriteStrategy()