org.schmant.task.io.zip
Class AbstractJavaZipTask<T extends AbstractJavaZipTask<T>>
java.lang.Object
org.schmant.support.AbstractArgumentChecker
org.schmant.task.stub.AbstractTask<T>
org.schmant.task.stub.AbstractActionTask<T>
org.schmant.task.stub.AbstractProcessTask<T>
org.schmant.task.template.io.zip.AbstractZipTask<T>
org.schmant.task.io.zip.AbstractJavaZipTask<T>
- All Implemented Interfaces:
- TaskDependency, ActionTaskConfigurable<T>, ActionTaskSpec<T>, LoggingConfigurable<T>, OverwriteConfigurable<T>, SourceConfigurable<T>, SourceConfigured, TargetConfigurable<T>, TargetConfigured, GeneratorTaskConfigurable<T>, GeneratorTaskSpec<T>, ProcessTaskConfigurable<T>, ProcessTaskSpec<T>, Task, TaskRunnable, TaskSpecification<T>
- Direct Known Subclasses:
- AbstractJarTask, ZipTask
public abstract class AbstractJavaZipTask<T extends AbstractJavaZipTask<T>>
- extends AbstractZipTask<T>
This is an abstract base class for Zip tasks that use Java's built in Zip
classes.
- Since:
- 0.5
- Author:
- Karl Gustafsson
- Task_package:
- org.schmant.task.base
Methods inherited from class org.schmant.task.stub.AbstractTask |
cancel, createTask, getDefaultLogFooter, getDefaultLogHeader, getDependencyForTasksScheduledByThisTask, getDependencyObservable, getFailureCause, getLogFooter, getLogHeader, getSatisfiedStateLock, getThis, isCancelled, isDone, isInterrupted, isRunning, isSatisfied, isSuccessful, run, runInternal, setLogFooter, setLogHeader, setReportLevel, setTraceLogging |
AbstractJavaZipTask
public AbstractJavaZipTask()
setLevel
public final void setLevel(int l)
getLevel
protected final Integer getLevel()
setMethod
public final void setMethod(int method)
setMethod
public final void setMethod(ZipCompressionMethod m)
getMethod
protected final Integer getMethod()
setEntryInfoProvider
public final void setEntryInfoProvider(ZipEntryInfoProvider zeip)
getEntryInfoProvider
protected final ZipEntryInfoProvider getEntryInfoProvider()
createIterator
protected abstract Iterator<? extends ZipEntryInfo> createIterator(SortedMap<AbsoluteLocation,EntityOrReadableFile> m)
- Subclasses implement this to create an iterator that will return
ZipEntryInfo
objects for each entry in the supplied map.
- Parameters:
m
- A map with the contents of the Zip file.
- Returns:
- A Zip entry info iterator.
createIterator
protected Iterator<? extends ZipEntryInfo> createIterator()
- Create the iterator for the
ZipCreator
. This method first
pre-interprets the sources
property using the
ArgumentInterpreter.preInterpret(Object)
method (flattening the
object list and evaluating all Producer
:s}, and then interprets
each resulting source object like this:
- If the source object is a
EntityAndAbsoluteLocation
, the
first object is interpreted as the source file or directory (see below).
The location object must be an AbsoluteLocation
or a
CharSequence
that can be used to create an AbsoluteLocation
.
- If the source object is any other object, it is interpreted as the
source file or directory (see below).
The source file or directory is interpreted according using the following
strategy:
- Try to interpret it as a named, readable file using
InterpretAsNamedReadableFileStrategy
.
- Interpret it with
InterpretAsReadOnlyDirectoryStrategy
- Returns:
- A
ZipEntryInfo
iterator.
copyProperties
public void copyProperties(T spec)
- Description copied from class:
AbstractActionTask
- Override the implementation from
AbstractTask
to copy the
source properties. Subclasses must override this to copy their own
properties.
- Specified by:
copyProperties
in interface TaskSpecification<T extends AbstractJavaZipTask<T>>
- Overrides:
copyProperties
in class AbstractProcessTask<T extends AbstractJavaZipTask<T>>
- Parameters:
spec
- The specification to copy properties to.