Class Unzip

  • All Implemented Interfaces:
    IVilType

    public class Unzip
    extends java.lang.Object
    implements IVilType
    Unpacks ZIP files.
    Author:
    Holger Eichelberger, kroeher
    • Constructor Detail

      • Unzip

        public Unzip()
    • Method Detail

      • unzip

        public static Set<FileArtifact> unzip​(Path zip,
                                              Path target)
                                       throws VilException
        Unpacks files in zip into target.
        Parameters:
        zip - the ZIP file to be unpacked
        target - the target path to unpack to
        Returns:
        the created artifacts
        Throws:
        VilException - in case of unpacking problems
      • unpack

        public static Set<FileArtifact> unpack​(Path zip,
                                               Path target,
                                               ZipHandler handler)
                                        throws VilException
        Unpacks files in zip into target.
        Parameters:
        zip - the ZIP file to be unpacked
        target - the target path to unpack to
        handler - the ZIP/JAR handler
        Returns:
        the created artifacts
        Throws:
        VilException - in case of unpacking problems
      • unpack

        public static Set<FileArtifact> unpack​(Path zip,
                                               Path target,
                                               java.lang.String pattern,
                                               ZipHandler handler)
                                        throws VilException
        Unpacks files in zip that matches the given filter into target.
        Parameters:
        zip - the ZIP file to be unpacked
        target - the target path to unpack to
        pattern - an optional ANT pattern used as a filter expression, typically a specific folder or package. May be null if no filter is required.
        handler - the ZIP/JAR handler
        Returns:
        the created artifacts
        Throws:
        VilException - in case of unpacking problems