Examples of ZipArchiver


Examples of org.codehaus.plexus.archiver.zip.ZipArchiver

            {
                throw new MojoExecutionException( "NPANDAY-1200-001", e );
            }
        }

        ZipArchiver zipArchiver = new ZipArchiver();
        zipArchiver.setDestFile( new File( outputDirectory + ".nar" ) );
        try
        {
            zipArchiver.addDirectory( new File( outputDirectory ) );
            zipArchiver.createArchive();
            getLog().info( "NPANDAY-1200-004: Created .NET Archive: File = " + outputDirectory + ".nar" );
        }
        catch ( ArchiverException e )
        {
            throw new MojoExecutionException( "NPANDAY-1200-002: Unable to create .NET archive:", e );
View Full Code Here

Examples of org.codehaus.plexus.archiver.zip.ZipArchiver

    public void testCreateArchiver_ShouldCreateZipArchiver()
        throws NoSuchArchiverException, ArchiverException
    {
        final MockManager mm = new MockManager();

        final ZipArchiver archiver = new ZipArchiver();

        final MockAndControlForAssemblyArchiver macArchiverManager = new MockAndControlForAssemblyArchiver( mm );

        macArchiverManager.expectGetArchiver( "zip", archiver );
View Full Code Here

Examples of org.codehaus.plexus.archiver.zip.ZipArchiver

        final Xpp3Dom dom2 = createComponentDom( new ComponentDef( "role", "hint2", "impl" ) );

        filter.components.put( "rolehint2", dom2 );

        final ZipArchiver archiver = new ZipArchiver();

        final File archiveFile = fileManager.createTempFile();

        archiver.setDestFile( archiveFile );

        final File descriptorFile = fileManager.createTempFile();

        archiver.setArchiveFinalizers( Collections.<ArchiveFinalizer>singletonList( filter ) );

        archiver.createArchive();

        final ZipFile zf = new ZipFile( archiveFile );

        final ZipEntry ze = zf.getEntry( ComponentsXmlArchiverFileFilter.COMPONENTS_XML_PATH );
View Full Code Here

Examples of org.codehaus.plexus.archiver.zip.ZipArchiver

      throw new MojoExecutionException("Unable to copy hardcoded container.xml file", e);
    }


    try {
      ZipArchiver zipArchiver = new ZipArchiver();
      zipArchiver.addDirectory(targetDirectory);
      zipArchiver.setCompress(true); // seems to not be a problem to have mimetype compressed
      zipArchiver.setDestFile(new File(targetDirectory.getParentFile(), result.getName())); // copy it to parent dir
      zipArchiver.createArchive();

      getLog().debug("epub file created at: " + zipArchiver.getDestFile().getAbsolutePath());
    } catch (Exception e) {
      throw new MojoExecutionException("Unable to zip epub file", e);
    }
  }
View Full Code Here

Examples of org.codehaus.plexus.archiver.zip.ZipArchiver

    } catch (IOException e) {
      throw new MojoExecutionException("Unable to copy hardcoded mimetype file", e);
    }

    try {
      ZipArchiver zipArchiver = new ZipArchiver();
      zipArchiver.addDirectory(targetDirectory);
      zipArchiver.setCompress(true); // seems to not be a problem to have mimetype compressed
      zipArchiver.setDestFile(new File(targetDirectory.getParentFile(), result.getName())); // copy it to parent dir
      zipArchiver.createArchive();

      getLog().debug("epub file created at: " + zipArchiver.getDestFile().getAbsolutePath());
    } catch (Exception e) {
      throw new MojoExecutionException("Unable to zip epub file", e);
    }
  }
View Full Code Here

Examples of org.codehaus.plexus.archiver.zip.ZipArchiver

            ((TarArchiver) archiver).setCompression(tarCompressionMethod);
            TarLongFileMode fileMode = new TarLongFileMode();
            fileMode.setValue(TarLongFileMode.GNU);
            ((TarArchiver) archiver).setLongfile(fileMode);
        } else if ("zip".equals(artifact.getType())) {
            archiver = new ZipArchiver();
        } else {
            throw new IllegalArgumentException("Unknown target type: " + artifact.getType());
        }
        archiver.setIncludeEmptyDirs(true);
        archiver.setDestFile(dest);
View Full Code Here

Examples of org.codehaus.plexus.archiver.zip.ZipArchiver

    } catch (IOException e) {
      throw new MojoExecutionException("Unable to copy hardcoded mimetype file", e);
    }

    try {
      ZipArchiver zipArchiver = new ZipArchiver();
      zipArchiver.addDirectory(targetDirectory);
      zipArchiver.setCompress(true); // seems to not be a problem to have mimetype compressed
      zipArchiver.setDestFile(new File(targetDirectory.getParentFile(), result.getName())); // copy it to parent dir
      zipArchiver.createArchive();

      getLog().debug("epub file created at: " + zipArchiver.getDestFile().getAbsolutePath());
    } catch (Exception e) {
      throw new MojoExecutionException("Unable to zip epub file", e);
    }
  }
View Full Code Here

Examples of org.codehaus.plexus.archiver.zip.ZipArchiver

        final Xpp3Dom dom2 = createComponentDom( new ComponentDef( "role", "hint2", "impl" ) );

        filter.components.put( "rolehint2", dom2 );

        final ZipArchiver archiver = new ZipArchiver();

        final File archiveFile = fileManager.createTempFile();

        archiver.setDestFile( archiveFile );

        final File descriptorFile = fileManager.createTempFile();

        archiver.setArchiveFinalizers( Collections.<ArchiveFinalizer>singletonList( filter ) );

        archiver.createArchive();

        final ZipFile zf = new ZipFile( archiveFile );

        final ZipEntry ze = zf.getEntry( ComponentsXmlArchiverFileFilter.COMPONENTS_XML_PATH );
View Full Code Here

Examples of org.codehaus.plexus.archiver.zip.ZipArchiver

    public void testCreateArchiver_ShouldCreateZipArchiver()
        throws NoSuchArchiverException, ArchiverException
    {
        final EasyMockSupport mm = new EasyMockSupport();

        final ZipArchiver archiver = new ZipArchiver();

        final MockAndControlForAssemblyArchiver macArchiverManager = new MockAndControlForAssemblyArchiver( mm );

        macArchiverManager.expectGetArchiver( "zip", archiver );
View Full Code Here

Examples of org.codehaus.plexus.archiver.zip.ZipArchiver

    } catch (IOException e) {
      throw new MojoExecutionException("Unable to copy hardcoded mimetype file", e);
    }

    try {
      ZipArchiver zipArchiver = (ZipArchiver) archiverManager.getArchiver("zip");
      zipArchiver.addDirectory(targetDirectory);
      zipArchiver.setCompress(true); // seems to not be a problem to have mimetype compressed
      zipArchiver.setDestFile(new File(targetDirectory.getParentFile(), result.getName())); // copy it to parent dir
      zipArchiver.createArchive();

      getLog().debug("epub file created at: " + zipArchiver.getDestFile().getAbsolutePath());
    } catch (Exception e) {
      throw new MojoExecutionException("Unable to zip epub file", e);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.