Class ZipOperation

java.lang.Object
rife.bld.operations.AbstractOperation<ZipOperation>
rife.bld.extension.ZipOperation

public class ZipOperation extends rife.bld.operations.AbstractOperation<ZipOperation>
Creates a zip archive of the provided sources and directories.
Since:
1.0
  • Constructor Details

    • ZipOperation

      public ZipOperation()
  • Method Details

    • execute

      public void execute() throws IOException
      Performs the zip operation.
      Specified by:
      execute in class rife.bld.operations.AbstractOperation<ZipOperation>
      Throws:
      IOException - when an exception occurred during the zip creation process
      Since:
      1.0
    • executeCreateDestinationDirectory

      protected void executeCreateDestinationDirectory()
      Part of the execute() operation, create the destination directory.
      Since:
      1.0
    • executeCreateZipArchive

      protected void executeCreateZipArchive() throws IOException
      Part of the execute() operation, create the zip archive.
      Throws:
      IOException
      Since:
      1.0
    • executeAddFileToZip

      protected void executeAddFileToZip(org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream zip, rife.bld.NamedFile file) throws IOException
      Part of the execute() operation, add a single file to the zip archive.
      Throws:
      IOException
      Since:
      1.0
    • sourceDirectories

      public ZipOperation sourceDirectories(File... directories)
      Provides source directories that will be used for the zip archive creation.
      Parameters:
      directories - source directories
      Returns:
      this operation instance
      Since:
      1.0
      See Also:
    • sourceDirectories

      public ZipOperation sourceDirectories(Path... directories)
      Provides source directories that will be used for the zip archive creation.
      Parameters:
      directories - source directories
      Returns:
      this operation instance
      Since:
      1.0
      See Also:
    • sourceDirectories

      public ZipOperation sourceDirectories(String... directories)
      Provides source directories that will be used for the zip archive creation.
      Parameters:
      directories - source directories
      Returns:
      this operation instance
      Since:
      1.0
      See Also:
    • sourceDirectories

      public ZipOperation sourceDirectories(List<File> directories)
      Provides a list of source directories that will be used for the zip archive creation.

      A copy will be created to allow this list to be independently modifiable.

      Parameters:
      directories - a list of source directories
      Returns:
      this operation instance
      Since:
      1.0
      See Also:
    • sourceDirectoriesPaths

      public ZipOperation sourceDirectoriesPaths(List<Path> directories)
      Provides a list of source directories that will be used for the zip archive creation.

      A copy will be created to allow this list to be independently modifiable.

      Parameters:
      directories - a list of source directories
      Returns:
      this operation instance
      Since:
      1.0
      See Also:
    • sourceDirectoriesStrings

      public ZipOperation sourceDirectoriesStrings(List<String> directories)
      Provides a list of source directories that will be used for the zip archive creation.

      A copy will be created to allow this list to be independently modifiable.

      Parameters:
      directories - a list of source directories
      Returns:
      this operation instance
      Since:
      1.0
      See Also:
    • sourceFiles

      public ZipOperation sourceFiles(rife.bld.NamedFile... files)
      Provides source files that will be used for the zip archive creation.
      Parameters:
      files - source files
      Returns:
      this operation instance
      Since:
      1.0
    • sourceFiles

      public ZipOperation sourceFiles(List<rife.bld.NamedFile> files)
      Provides a list of source files that will be used for the zip archive creation.

      A copy will be created to allow this list to be independently modifiable.

      Parameters:
      files - a list of source files
      Returns:
      this operation instance
      Since:
      1.0
    • destinationDirectory

      public ZipOperation destinationDirectory(File directory)
      Provides the destination directory in which the zip archive will be created.
      Parameters:
      directory - the zip destination directory
      Returns:
      this operation instance
      Since:
      1.0
    • destinationDirectory

      public ZipOperation destinationDirectory(Path directory)
      Provides the destination directory in which the zip archive will be created.
      Parameters:
      directory - the zip destination directory
      Returns:
      this operation instance
      Since:
      1.0
    • destinationDirectory

      public ZipOperation destinationDirectory(String directory)
      Provides the destination directory in which the zip archive will be created.
      Parameters:
      directory - the zip destination directory
      Returns:
      this operation instance
      Since:
      1.0
    • destinationFileName

      public ZipOperation destinationFileName(String name)
      Provides the destination file name that will be used for the zip archive creation.
      Parameters:
      name - the zip archive destination file name
      Returns:
      this operation instance
      Since:
      1.0
    • included

      public ZipOperation included(String... included)
      Provides regex patterns that will be found to determine which files will be included in the javadoc generation.
      Parameters:
      included - inclusion patterns
      Returns:
      this operation instance
      Since:
      1.0
    • included

      public ZipOperation included(Pattern... included)
      Provides patterns that will be found to determine which files will be included in the zip archive.
      Parameters:
      included - inclusion patterns
      Returns:
      this operation instance
      Since:
      1.0
    • included

      public ZipOperation included(List<Pattern> included)
      Provides a list of patterns that will be found to determine which files will be included in the zip archive.

      A copy will be created to allow this list to be independently modifiable.

      Parameters:
      included - a list of inclusion patterns
      Returns:
      this operation instance
      Since:
      1.0
    • excluded

      public ZipOperation excluded(String... excluded)
      Provides regex patterns that will be found to determine which files will be excluded from the javadoc generation.
      Parameters:
      excluded - exclusion patterns
      Returns:
      this operation instance
      Since:
      1.0
    • excluded

      public ZipOperation excluded(Pattern... excluded)
      Provides patterns that will be found to determine which files will be excluded from the zip archive.
      Parameters:
      excluded - exclusion patterns
      Returns:
      this operation instance
      Since:
      1.0
    • excluded

      public ZipOperation excluded(List<Pattern> excluded)
      Provides a list of patterns that will be found to determine which files will be excluded from the zip archive.

      A copy will be created to allow this list to be independently modifiable.

      Parameters:
      excluded - a list of exclusion patterns
      Returns:
      this operation instance
      Since:
      1.0
    • sourceDirectories

      public List<File> sourceDirectories()
      Retrieves the list of source directories that will be used for the zip archive creation.

      This is a modifiable list that can be retrieved and changed.

      Returns:
      the zip archive's source directories
      Since:
      1.0
    • sourceFiles

      public List<rife.bld.NamedFile> sourceFiles()
      Retrieves the list of source files that will be used for the zip archive creation.

      This is a modifiable list that can be retrieved and changed.

      Returns:
      the zip archive's source files
      Since:
      1.0
    • destinationDirectory

      public File destinationDirectory()
      Retrieves the destination directory in which the zip archive will be created.
      Returns:
      the zip archive's destination directory
      Since:
      1.0
    • destinationFileName

      public String destinationFileName()
      Retrieves the destination file name that will be used for the zip archive creation.
      Returns:
      the zip archive's destination file name
      Since:
      1.0
    • destinationFile

      public File destinationFile()
      Retrieves the destination file where the zip archive will be created.
      Returns:
      the zip archive's destination file
      Since:
      1.0
    • included

      public List<Pattern> included()
      Retrieves the list of patterns that will be evaluated to determine which files will be included in the zip archive.

      This is a modifiable list that can be retrieved and changed.

      Returns:
      the zip's archive's inclusion patterns
      Since:
      1.0
    • excluded

      public List<Pattern> excluded()
      Retrieves the list of patterns that will be evaluated to determine which files will be excluded the zip archive.

      This is a modifiable list that can be retrieved and changed.

      Returns:
      the zip's archive's exclusion patterns
      Since:
      1.0