saker.zip Documentation TaskDoc JavaDoc Packages
public interface ZipCreationTaskBuilder
Interface for configuring and creating a ZIP creation task.

The builder allows setting up a build task invocation that generates a ZIP archive with the configured contents.

The builder can be instantiated using newBuilder().

The interface may be implemented in some cases, but in general, it is not recommended doing so.

Methods
public void
Adds an archive of which the contents of should be added to the created ZIP.
public void
addResource(FileLocation location, SakerPath archivepath)
Adds a file to be added to the created archive.
public default void
addResource(FileLocation location, ZipResourceEntry resourceentry)
Adds a file to be added to the created archive.
public void
Adds a resource transformer to the ZIP creation task.
public TaskFactory<?>
Builds the task based on the current state of the builder.
public TaskIdentifier
Builds a task identifier that can be used to start the task.
public static ZipCreationTaskBuilder
Creates a new builder instance.
public void
setModificationTime(Date modificationTime)
Sets the default modification time that should be set for the archive entries.
public void
Sets the output location where the archive should be created to.
public abstract void addIncludeArchive(FileLocation archive, IncludeResourceMapping mapping) throws NullPointerException
Adds an archive of which the contents of should be added to the created ZIP.

The archiving task will enumerate the entries in the specified ZIP archive and include them with the paths specified with the given mapping.

archiveThe archive from which the entries should be included.
mappingThe resource mapping that defines the archive paths of the included entries. If null, the identity mapping is used.
NullPointerExceptionIf the archive is null.
public abstract void addResource(FileLocation location, SakerPath archivepath) throws NullPointerException, InvalidPathFormatException
Adds a file to be added to the created archive.
locationThe location of the file.
archivepathThe archive path that the file should be added as.
NullPointerExceptionIf any of the arguments are null.
InvalidPathFormatExceptionIf the resource archive path is not forward relative or has no file name.
public default void addResource(FileLocation location, ZipResourceEntry resourceentry) throws NullPointerException, InvalidPathFormatException
Adds a file to be added to the created archive.
locationThe location of the file.
resourceentryThe ZIP resource entry describing the archive entry.
NullPointerExceptionIf any of the arguments are null.
InvalidPathFormatExceptionIf the resource archive path is not forward relative or has no file name.
saker.zip 0.8.5
Adds a resource transformer to the ZIP creation task.

Resource transformers can be used to modify the contents of the created ZIP in a dynamic manner.

transformerThe resource transformer.
NullPointerExceptionIf the argument is null.
Builds the task based on the current state of the builder.

The builder can be reused after this call.

The task factory.
IllegalStateExceptionIf the required properties of the task is not set.
Builds a task identifier that can be used to start the task.

The builder can be reused after this call.

The task identifier.
IllegalStateExceptionIf the required properties of the task is not set.
Creates a new builder instance.
The created builder.
public abstract void setModificationTime(Date modificationTime)
Sets the default modification time that should be set for the archive entries.

The archive entries will have this modification time set for them.

This modification time will not be set for included archive entries. The modification time for them is based on their modification time in the source archive.

modificationTimeThe modification time or null to use the default.
public abstract void setOutputPath(SakerPath outputPath) throws NullPointerException, IllegalArgumentException
Sets the output location where the archive should be created to.

The specified path must be absolute.

Setting the output path is required before calling the build methods.

outputPathThe output path.
NullPointerExceptionIf the argument is null.
IllegalArgumentExceptionIf the argument is not an absolute path or has no file name.