adams.gui.tools.previewbrowser
Class ZipArchiveHandler

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.gui.tools.previewbrowser.AbstractArchiveHandler
              extended by adams.gui.tools.previewbrowser.ZipArchiveHandler
All Implemented Interfaces:
Debuggable, Destroyable, OptionHandler, SizeOfHandler, Serializable

public class ZipArchiveHandler
extends AbstractArchiveHandler

Offers access to ZIP files. Handles the following extensions: zip,jar

Valid options are:

-D <int> (property: debugLevel)
    The greater the number the more additional info the scheme may output to
    the console (0 = off).
    default: 0
    minimum: 0
 
-archive <adams.core.io.PlaceholderFile> (property: archive)
    The archive to obtain the files from.
    default: .
 

Version:
$Revision: 4584 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class adams.gui.tools.previewbrowser.AbstractArchiveHandler
m_Archive, m_Relation
 
Fields inherited from class adams.core.option.AbstractOptionHandler
m_DebugLevel, m_OptionManager
 
Constructor Summary
ZipArchiveHandler()
           
 
Method Summary
protected  boolean doExtract(String archiveFile, File outFile)
          Extracts the specified file and saves it locally.
 String[] getExtensions()
          Returns the list of extensions (without dot) that this handler can take care of.
 String globalInfo()
          Returns a string describing the object.
protected  String[] listFiles()
          Performs actual listing of files.
 
Methods inherited from class adams.gui.tools.previewbrowser.AbstractArchiveHandler
archiveTipText, checkArchive, defineOptions, extract, getArchive, getFiles, getHandlers, getHandlersForFile, getHandlersForFile, getRelation, hasHandler, hasHandler, setArchive
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debug, debugLevelTipText, destroy, finishInit, getDebugLevel, getOptionManager, initialize, isDebugOn, newOptionManager, reset, setDebugLevel, toCommandLine, toString
 
Methods inherited from class adams.core.ConsoleObject
getDebugging, getSystemErr, getSystemOut, sizeOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ZipArchiveHandler

public ZipArchiveHandler()
Method Detail

globalInfo

public String globalInfo()
Returns a string describing the object.

Specified by:
globalInfo in class AbstractOptionHandler
Returns:
a description suitable for displaying in the gui

getExtensions

public String[] getExtensions()
Returns the list of extensions (without dot) that this handler can take care of.

Specified by:
getExtensions in class AbstractArchiveHandler
Returns:
the list of extensions (no dot)

listFiles

protected String[] listFiles()
Performs actual listing of files.

Specified by:
listFiles in class AbstractArchiveHandler
Returns:
the stored files

doExtract

protected boolean doExtract(String archiveFile,
                            File outFile)
Extracts the specified file and saves it locally.

Specified by:
doExtract in class AbstractArchiveHandler
Parameters:
archiveFile - the file in the archive to extract
outFile - the local file to store the content in
Returns:
true if successfully extracted


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.