use of org.codehaus.plexus.archiver.manager.NoSuchArchiverException in project sling by apache.
the class PreparePackageMojo method unpack.
private void unpack(File source, File destination) throws MojoExecutionException {
getLog().info("Unpacking " + source.getPath() + " to\n " + destination.getPath());
try {
destination.mkdirs();
UnArchiver unArchiver = archiverManager.getUnArchiver(source);
unArchiver.setSourceFile(source);
unArchiver.setDestDirectory(destination);
unArchiver.extract();
} catch (NoSuchArchiverException e) {
throw new MojoExecutionException("Unable to find archiver for " + source.getPath(), e);
} catch (ArchiverException e) {
throw new MojoExecutionException("Unable to unpack " + source.getPath(), e);
}
}
use of org.codehaus.plexus.archiver.manager.NoSuchArchiverException in project sling by apache.
the class PreparePackageMojo method unpack.
/**
* Unpack a file
*/
private void unpack(final File source, final File destination) throws MojoExecutionException {
getLog().debug("Unpacking " + source.getPath() + " to\n " + destination.getPath());
try {
destination.mkdirs();
final UnArchiver unArchiver = archiverManager.getUnArchiver(source);
unArchiver.setSourceFile(source);
unArchiver.setDestDirectory(destination);
unArchiver.extract();
} catch (final NoSuchArchiverException e) {
throw new MojoExecutionException("Unable to find archiver for " + source.getPath(), e);
} catch (final ArchiverException e) {
throw new MojoExecutionException("Unable to unpack " + source.getPath(), e);
}
}
Aggregations