use of org.apache.maven.plugins.assembly.archive.ArchiveExpansionException in project maven-plugins by apache.
the class AssemblyFileUtils method unpack.
/**
* Unpacks the archive file.
*
* @param source File to be unpacked.
* @param destDir Location where to put the unpacked files.
*/
public static void unpack(File source, File destDir, ArchiverManager archiverManager) throws ArchiveExpansionException, NoSuchArchiverException {
try {
UnArchiver unArchiver = archiverManager.getUnArchiver(source);
unArchiver.setSourceFile(source);
unArchiver.setDestDirectory(destDir);
unArchiver.extract();
} catch (ArchiverException e) {
throw new ArchiveExpansionException("Error unpacking file: " + source + "to: " + destDir, e);
}
}
Aggregations