org.at4j.util.archive
Class PrintingEntryExtractor

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

public class PrintingEntryExtractor
extends Object
implements EntryExtractionStrategy

This entry extraction strategy just prints the location and types of the entries that it encounters to a PrintStream (System.out, for instance). It does not extract anything.

Since:
1.0
Author:
Karl Gustafsson

Constructor Summary
PrintingEntryExtractor()
          Create a printing entry extractor that prints to System.out.
PrintingEntryExtractor(PrintStream out)
          Create a printing entry extractor that prints to the supplied stream.
 
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)
          Extract a symbolic link entry to the target directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrintingEntryExtractor

public PrintingEntryExtractor()
Create a printing entry extractor that prints to System.out.


PrintingEntryExtractor

public PrintingEntryExtractor(PrintStream out)
Create a printing entry extractor that prints to the supplied stream.

Parameters:
out - The stream to print to.
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)
Description copied from interface: EntryExtractionStrategy
Extract a symbolic link entry to the target directory.

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