Package org.codehaus.plexus.archiver

Examples of org.codehaus.plexus.archiver.UnArchiver


    {
        String archiveExt = FileUtils.getExtension( file.getAbsolutePath() ).toLowerCase();
   
        try
        {
            UnArchiver unArchiver = this.archiverManager.getUnArchiver( archiveExt );
   
            unArchiver.setSourceFile( file );
   
            unArchiver.setDestDirectory( location );
   
            unArchiver.extract();
        }
        catch ( IOException e )
        {
            throw new MojoExecutionException( "Error unpacking file: " + file + "to: " + location, e );
        }
View Full Code Here


        throws MojoExecutionException
    {
        final String archiveExt = FileUtils.getExtension(file.getAbsolutePath()).toLowerCase();
        try
        {
            final UnArchiver unArchiver;
            unArchiver = this.archiverManager.getUnArchiver(archiveExt);
            unArchiver.setSourceFile(file);
            location.mkdirs();
            unArchiver.setDestDirectory(location);
            unArchiver.extract();
        }
        catch (Throwable throwable)
        {
            if (throwable instanceof IOException || throwable instanceof ArchiverException)
            {
View Full Code Here

        throws MojoExecutionException
    {
        final String archiveExt = FileUtils.getExtension(file.getAbsolutePath()).toLowerCase();
        try
        {
            final UnArchiver unArchiver;
            unArchiver = this.archiverManager.getUnArchiver(archiveExt);
            unArchiver.setSourceFile(file);
            unArchiver.setDestDirectory(location);
            unArchiver.extract();
        }
        catch (Throwable throwable)
        {
            if (throwable instanceof IOException || throwable instanceof ArchiverException)
            {
View Full Code Here

        throws MojoExecutionException
    {
        final String archiveExt = FileUtils.getExtension(file.getAbsolutePath()).toLowerCase();
        try
        {
            final UnArchiver unArchiver;
            unArchiver = this.archiverManager.getUnArchiver(archiveExt);
            unArchiver.setSourceFile(file);
            location.mkdirs();
            unArchiver.setDestDirectory(location);
            unArchiver.extract();
        }
        catch (Throwable throwable)
        {
            if (throwable instanceof IOException || throwable instanceof ArchiverException)
            {
View Full Code Here

    {
        final String archiveExt = FileUtils.getExtension(file.getAbsolutePath()).toLowerCase();
        try
        {
            location.mkdirs();
            UnArchiver unArchiver;
            unArchiver = archiverManager.getUnArchiver(archiveExt);
            unArchiver.setSourceFile(file);
            unArchiver.setDestDirectory(location);
            unArchiver.extract();
        }
        catch (NoSuchArchiverException e)
        {
            throw new MojoExecutionException("Unknown archiver type", e);
        }
View Full Code Here

    {
        final String archiveExt = FileUtils.getExtension(file.getAbsolutePath()).toLowerCase();
        try
        {
            location.mkdirs();
            UnArchiver unArchiver;
            unArchiver = archiverManager.getUnArchiver(archiveExt);
            unArchiver.setSourceFile(file);
            unArchiver.setDestDirectory(location);
            unArchiver.extract();
        }
        catch (NoSuchArchiverException e)
        {
            throw new MojoExecutionException("Unknown archiver type", e);
        }
View Full Code Here

   * @param destinationDirectory destination directory
   * @throws MojoExecutionException some error occurred
   */
  private void unpackArchive(File archive, File destinationDirectory) throws MojoExecutionException {
    try {
      UnArchiver unArchiver = archiverManager.getUnArchiver(archive);
      unArchiver.setSourceFile(archive);
      unArchiver.setDestDirectory(destinationDirectory);
      unArchiver.setOverwrite(false);
      unArchiver.extract();
      log.info("Unpacked artifact archive " + archive.getName());
    } catch (Exception e) {
      log.error("Failed to unpack artifact archive " + archive.getName(), e);
      throw new MojoExecutionException("Failed to unpack artifact archive " + archive.getName());
    }
View Full Code Here

    getLog().info("Using locale list : " + getLocaleList());
    env.setLocaleList(getLocaleList());
    env.setLayerOptimize(getLayerOptimize());
    env.build();
    try {
      UnArchiver ua = getArchiverManager().getUnArchiver(env.getTargetJar());
      File resourceDir = new File(getProject().getBuild().getDirectory(), "/generated-resources/dojo");
      FileUtils.forceMkdir(resourceDir);
      ua.setSourceFile(env.getTargetJar());
      ua.setDestDirectory(resourceDir);
      ua.setOverwrite(true);
      ua.extract();
    } catch (IOException e) {
      getLog().error("Failed to copy dojo release jar", e);
      throw new MojoExecutionException("Failed to copy dojo release jar");
    } catch (NoSuchArchiverException e) {
      getLog().error("Failed to unarchive dojo release jar", e);
View Full Code Here

    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);
        }
View Full Code Here

            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);
        }
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.archiver.UnArchiver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.