de.esprit.appsuite.appstore

## Class ZipSoftwareExtractor

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.appsuite.launch.AbstractApplicationObject<C>
    - - de.esprit.appsuite.task.AbstractAsyncExecutable<C>
      - - de.esprit.appsuite.io.archive.AbstractArchiveExtractor<C,ZipArchiveEntry>
        - - de.esprit.appsuite.io.archive.zip.ZipExtractor
          - - de.esprit.appsuite.appstore.ZipSoftwareExtractor

- All Implemented Interfaces:
    ApplicationObject, AsyncExecutable, CancellableTask, TaskMonitorSupport, SimpleLogSupport, Dumpable, Executable

      public class ZipSoftwareExtractor
      extends ZipExtractor

  This class extracts zipped software data directly from an input stream to a given target directory. After installation it writes a timestampFile to the target directory, which contains a list of all extracted files and directories.
  Author:
    Rainer Buesch

- - ### Field Summary

    - ### Fields inherited from class de.esprit.appsuite.task.AbstractAsyncExecutable

      `childTaskRef, isTestMode, monitorController, resultRef, stateFlag`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ZipSoftwareExtractor(ApplicationContext ctx, java.io.InputStream inStream, FileInfo fileInfo, java.io.File targetDir, java.io.FileFilter excludeFilter, java.lang.String repository, java.io.File timestampFile, long timestamp)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `doOnCancel()` This method is called after having detected cancellation.
    `protected void` | `doOnDirectoryCreated(ArchiveEntry entry, java.io.File relativeDir)`
    `protected void` | `doOnFailure(java.lang.Exception error)` Is called when the task failed.
    `protected void` | `doOnFileCreating(ArchiveEntry entry)` Passes the relative fileName as argument.
    `java.util.List<java.lang.String>` | `getExtractionList()`
    `protected void` | `processArchive()`
    `protected void` | `purgeTargetDir()`

    - ### Methods inherited from class de.esprit.appsuite.io.archive.zip.ZipExtractor

      `getArchiveType, getProgressInputStream, setEncoding, setInputStream, setInputStream`

    - ### Methods inherited from class de.esprit.appsuite.io.archive.AbstractArchiveExtractor

      `checkStreamAccess, createOutputStream, displayArchiveEntry, displayHeader, doOnFileCreated, executeAsync, extractAsDirectory, extractToFile, getInputFile, getTargetDir, isShouldExtract, setExtractionFilter, setInputFile, setTargetDir`

    - ### Methods inherited from class de.esprit.appsuite.task.AbstractAsyncExecutable

      `addMonitor, checkCancelled, checkForErrorAndRethrow, clearMonitors, createRunStateFlag, execute, executeSubTask, getError, getMaxProgressSteps, getMonitorCount, getMonitors, getName, getProgressStepCount, getResult, getRunStateFlag, getTaskId, getType, handleCancellation, handleFailure, handleFinish, handleStart, handleSuccess, hasError, hasMonitor, isCancellable, notifyProceeded, registerTaskStateChange, removeMonitor, resetProgress, setCancellable, setLogLevel, setMaxProgressSteps, setMonitor, setName, setName, setResult, setRunStateFlag, setTaskId, setType, shouldFireMonitor, sleepChecked, wasCancelled`

    - ### Methods inherited from class de.esprit.appsuite.launch.AbstractApplicationObject

      `getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel`

    - ### Methods inherited from class de.esprit.common.util.DumpableObject

      `configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface de.esprit.appsuite.launch.ApplicationObject

      `getApplicationContext`

    - ### Methods inherited from interface de.esprit.common.log.SimpleLogSupport

      `getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel`

- - ### Constructor Detail

    - #### ZipSoftwareExtractor

          public ZipSoftwareExtractor(ApplicationContext ctx,
                              java.io.InputStream inStream,
                              FileInfo fileInfo,
                              java.io.File targetDir,
                              java.io.FileFilter excludeFilter,
                              java.lang.String repository,
                              java.io.File timestampFile,
                              long timestamp)

  - ### Method Detail

    - #### getExtractionList

          public java.util.List<java.lang.String> getExtractionList()

    - #### doOnDirectoryCreated

          protected void doOnDirectoryCreated(ArchiveEntry entry,
                                  java.io.File relativeDir)

      Overrides:
        `doOnDirectoryCreated` in class `AbstractArchiveExtractor`

    - #### doOnFileCreating

          protected void doOnFileCreating(ArchiveEntry entry)

      Description copied from class: `AbstractArchiveExtractor`
      Passes the relative fileName as argument. The absolute name can be constructed if needed like this: new File(getTargetDir(), fileName)
      Overrides:
        `doOnFileCreating` in class `AbstractArchiveExtractor`

    - #### processArchive

          protected void processArchive()
                                 throws java.lang.Exception

      Overrides:
        `processArchive` in class `ZipExtractor`
      Throws:
        `java.lang.Exception`

    - #### doOnCancel

          protected void doOnCancel()

      Description copied from class: `AbstractAsyncExecutable`
      This method is called after having detected cancellation. May be overridden to perform any cleanup. Note that any Exceptions thrown are caught and just logged but do NOT affect the task.
      Overrides:
        `doOnCancel` in class `AbstractAsyncExecutable`

    - #### doOnFailure

          protected void doOnFailure(java.lang.Exception error)

      Description copied from class: `AbstractAsyncExecutable`
      Is called when the task failed. Maybe overridden to perform any cleanup on error. Note that any Exceptions thrown are caught and just logged but do NOT affect the task.
      Overrides:
        `doOnFailure` in class `AbstractAsyncExecutable`

    - #### purgeTargetDir

          protected void purgeTargetDir()
                                 throws java.lang.Exception

      Throws:
        `java.lang.Exception`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.