Class Archiver


  • public class Archiver
    extends Object
    Archiving utility class
    Author:
    anthonyd
    • Constructor Detail

      • Archiver

        public Archiver()
    • Method Detail

      • archive

        public static FilePath archive​(FilePath workspace,
                                       String[] paths,
                                       String[] excludePaths,
                                       String prefix)
                                throws IOException,
                                       InterruptedException
        Creates zips of the workspace using an array of path filters (in Ant GLOB format) to determine which files to include in the zip. The zip file will have a random name with a specified prefix.
        Parameters:
        workspace - Workspace for the job.
        paths - Paths in the ANT Glob format to include.
        excludePaths - Paths in the ANT Glob format to exclude.
        prefix - Prefix of the zip file to create.
        Returns:
        The zip archive FilePath.
        Throws:
        IOException - if there is a problem reading input files or writing output files
        InterruptedException - bubbles from workspace.list