org.codehaus.plexus.archiver.zip.ZipUnArchiver Java Examples

The following examples show how to use org.codehaus.plexus.archiver.zip.ZipUnArchiver. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Utils.java    From usergrid with Apache License 2.0 5 votes vote down vote up
/**
 * @param jarFile Jar file to be extracted
 * @param destinationFolder Folder which the jarFile will be extracted to. Jar file's root will be this folder once
 * it is extracted.
 */
public static void extractJar( File jarFile, String destinationFolder ) throws MojoExecutionException {
    try {
        ZipUnArchiver unArchiver = new ZipUnArchiver( jarFile );
        unArchiver.enableLogging( new ConsoleLogger( org.codehaus.plexus.logging.Logger.LEVEL_INFO, "console" ) );
        unArchiver.setDestDirectory( new File( destinationFolder ) );
        unArchiver.extract();
    }
    catch ( Exception e ) {
        throw new MojoExecutionException( "Error while extracting JAR file", e );
    }
}
 
Example #2
Source File: WisdomRuntimeExpander.java    From wisdom with Apache License 2.0 4 votes vote down vote up
private static void unzip(final AbstractWisdomMojo mojo, File in, File out) {
    ZipUnArchiver unarchiver = new ZipUnArchiver(in);
    unarchiver.enableLogging(new PlexusLoggerWrapper(mojo.getLog()));
    unarchiver.setDestDirectory(out);
    unarchiver.extract();
}