org.at4j.util.archive
Class EntryExtractor

java.lang.Object
  extended by org.at4j.util.archive.EntryExtractor
All Implemented Interfaces:
EntryExtractionStrategy

public class EntryExtractor
extends Object
implements EntryExtractionStrategy

This is the default EntryExtractionStrategy used by the ArchiveExtractor. It extracts all entries to the target directory hierarchy.

This object does not have any state. The singleton instance INSTANCE may be used instead of instantiating it.

Since:
1.0
Author:
Karl Gustafsson

Field Summary
static EntryExtractor INSTANCE
          Singleton instance that may be used instead of instantiating this class.
 
Constructor Summary
EntryExtractor()
           
 
Method Summary
 Directory extractDirectory(ArchiveDirectoryEntry<?,?> dir, PotentialDirectory target, ExtractSpecification spec)
          Extract a directory entry to the target directory.
 void extractFile(ArchiveFileEntry<?,?> f, PotentialDirectory target, ExtractSpecification spec)
          Extract a file entry to the target directory.
 void extractSymbolicLink(ArchiveSymbolicLinkEntry<?,?> l, PotentialDirectory target, ExtractSpecification spec)
          This method just prints a warning to stderr about that it could not extract the symbolic link.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final EntryExtractor INSTANCE
Singleton instance that may be used instead of instantiating this class.

Constructor Detail

EntryExtractor

public EntryExtractor()
Method Detail

extractDirectory

public Directory extractDirectory(ArchiveDirectoryEntry<?,?> dir,
                                  PotentialDirectory target,
                                  ExtractSpecification spec)
Description copied from interface: EntryExtractionStrategy
Extract a directory entry to the target directory.

Specified by:
extractDirectory in interface EntryExtractionStrategy
Parameters:
dir - The directory entry.
target - The target directory.
spec - The extraction specification.
Returns:
The new directory. If no directory was created as a result of this operation, null should be returned.

extractFile

public void extractFile(ArchiveFileEntry<?,?> f,
                        PotentialDirectory target,
                        ExtractSpecification spec)
Description copied from interface: EntryExtractionStrategy
Extract a file entry to the target directory.

Specified by:
extractFile in interface EntryExtractionStrategy
Parameters:
f - The file entry.
target - The target directory.
spec - The extraction specification.

extractSymbolicLink

public void extractSymbolicLink(ArchiveSymbolicLinkEntry<?,?> l,
                                PotentialDirectory target,
                                ExtractSpecification spec)
This method just prints a warning to stderr about that it could not extract the symbolic link.

Specified by:
extractSymbolicLink in interface EntryExtractionStrategy
Parameters:
l - The symbolic link entry.
target - The target directory.
spec - The extraction specification.