gpt4 book ai didi

org.codehaus.plexus.archiver.zip.ZipArchiver.addDirectory()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 07:16:49 28 4
gpt4 key购买 nike

本文整理了Java中org.codehaus.plexus.archiver.zip.ZipArchiver.addDirectory()方法的一些代码示例,展示了ZipArchiver.addDirectory()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipArchiver.addDirectory()方法的具体详情如下:
包路径:org.codehaus.plexus.archiver.zip.ZipArchiver
类名称:ZipArchiver
方法名:addDirectory

ZipArchiver.addDirectory介绍

暂无

代码示例

代码示例来源:origin: apache/usergrid

/**
 * @param jarFile Jar file to be created
 * @param sourceFolder Jar file will be created out of the contents of this folder. This corresponds to the root
 * folder of the jar file once it is created.
 */
public static void archiveWar( File jarFile, String sourceFolder ) throws MojoExecutionException {
  try {
    ZipArchiver archiver = new ZipArchiver();
    archiver.enableLogging( new ConsoleLogger( org.codehaus.plexus.logging.Logger.LEVEL_INFO, "console" ) );
    archiver.setDestFile( jarFile );
    archiver.addDirectory( new File( sourceFolder ), "", new String[] { "**/*" }, null );
    archiver.createArchive();
  }
  catch ( Exception e ) {
    throw new MojoExecutionException( "Error while creating WAR file", e );
  }
}

代码示例来源:origin: Evolveum/midpoint

private File generateArchive(File outDir, String archiveFilename) throws IOException, ArchiverException {
  File zipFile = new File(buildDir, archiveFilename);
  if (zipFile.exists()) {
    zipFile.delete();
  }
  zipArchiver.addDirectory(outDir);
  zipArchiver.setDestFile(zipFile);
  zipArchiver.createArchive();
  return zipFile;
}

代码示例来源:origin: fabric8io/fabric8-maven-plugin

public static void createArchive(File sourceDir, File destinationFile, ZipArchiver archiver) throws MojoExecutionException {
  try {
    archiver.addDirectory(sourceDir);
    archiver.setDestFile(destinationFile);
    archiver.createArchive();
  } catch (IOException e) {
    throw new MojoExecutionException("Failed to create archive " + destinationFile + ": " + e, e);
  }
}

代码示例来源:origin: org.codehaus.tycho/maven-osgi-packaging-plugin

private void packDir(File sourceDir, File targetZip) throws MojoExecutionException {
  ZipArchiver archiver ;
  try {
    archiver = (ZipArchiver) plexus.lookup(ZipArchiver.ROLE, "zip");
  } catch (ComponentLookupException e) {
    throw new MojoExecutionException("Unable to resolve ZipArchiver", e);
  }
  
  archiver.setDestFile(targetZip);
  try {
    archiver.addDirectory(sourceDir);
    archiver.createArchive();
  } catch (Exception e) {
    throw new MojoExecutionException("Error packing zip", e);
  }
}

代码示例来源:origin: org.apache.npanday.plugins/maven-aspx-plugin

archiver.addDirectory( webappDir );

代码示例来源:origin: org.codehaus.tycho/maven-osgi-packaging-plugin

zipper.addDirectory( target );
zipper.setDestFile( destFile );
zipper.createArchive();

代码示例来源:origin: opoo/opoopress

zipArchiver.setForced(forceCreation);
zipArchiver.addDirectory(basedir, getIncludes(), getExcludes());
  zipArchiver.addDirectory(buildDirectory, new String[]{"plugins/**"}, null);

代码示例来源:origin: org.apache.sling/maven-launchpad-plugin

zipArchiver.addDirectory(this.configOutputDir);
zipArchiver.createArchive();

代码示例来源:origin: org.apache.sling/maven-launchpad-plugin

zipArchiver.addDirectory(this.configOutputDir);
zipArchiver.createArchive();

代码示例来源:origin: mojohaus/nbm-maven-plugin

archiver.addDirectory( webstartBuildDir );
archiver.addDirectory( webstartBuildDir, null, new String[] { "**/*.jnlp" } );
for ( final File jnlp : webstartBuildDir.listFiles() )

代码示例来源:origin: org.codehaus.mojo/nbm-maven-plugin

archiver.addDirectory( webstartBuildDir );
archiver.addDirectory( webstartBuildDir, null, new String[] { "**/*.jnlp" } );
for ( final File jnlp : webstartBuildDir.listFiles() )

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com