Search in sources :

Example 1 with ArchiveExpansionException

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);
    }
}
Also used : ArchiverException(org.codehaus.plexus.archiver.ArchiverException) NoSuchArchiverException(org.codehaus.plexus.archiver.manager.NoSuchArchiverException) ArchiveExpansionException(org.apache.maven.plugins.assembly.archive.ArchiveExpansionException) UnArchiver(org.codehaus.plexus.archiver.UnArchiver)

Aggregations

ArchiveExpansionException (org.apache.maven.plugins.assembly.archive.ArchiveExpansionException)1 ArchiverException (org.codehaus.plexus.archiver.ArchiverException)1 UnArchiver (org.codehaus.plexus.archiver.UnArchiver)1 NoSuchArchiverException (org.codehaus.plexus.archiver.manager.NoSuchArchiverException)1