org.apache.tools.ant.taskdefs.Expand.setOverwrite()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(100)

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

Expand.setOverwrite介绍

[英]Should we overwrite files in dest, even if they are newer than the corresponding entries in the archive?
[中]我们是否应该覆盖dest中的文件,即使它们比归档中的相应条目更新?

代码示例

代码示例来源:origin: HuaweiBigData/StreamCQL

private Expand createExpand(File jarFile)
{
  String outputDir = expandDir + File.separator + jarFile.getName();
  Project prj = new Project();
  FileSet fileSet = createFileSetForJarFile(jarFile, prj);
  PatternSet patternSet = createPatternSet(prj);
  Expand expand = new Expand();
  expand.setProject(prj);
  expand.setOverwrite(true);
  expand.setDest(new File(outputDir));
  expand.addFileset(fileSet);
  expand.addPatternset(patternSet);
  return expand;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-j2me-common-ant

private void extractZip(final File source, final File target) throws BuildException
{
  final Expand e = new Expand();
  e.setProject(getProject());
  e.setOverwrite(false);
  if (excludeManifest)
  {
    final PatternSet ps = new PatternSet();
    ps.setExcludes("META-INF,META-INF/MANIFEST.MF"); //NOI18N
    e.addPatternset(ps);
  }
  e.setSrc(source);
  e.setDest(target);
  e.execute();
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mobility-antext

private void extractZip(final File source, final File target) throws BuildException
{
  final Expand e = new Expand();
  e.setProject(getProject());
  e.setOverwrite(false);
  if (excludeManifest)
  {
    final PatternSet ps = new PatternSet();
    ps.setExcludes("META-INF,META-INF/MANIFEST.MF"); //NOI18N
    e.addPatternset(ps);
  }
  e.setSrc(source);
  e.setDest(target);
  e.execute();
}

代码示例来源:origin: net.sf.antenna/antenna

expand.setSrc(getJarFile());
expand.setDest(tmpDir);
expand.setOverwrite(true);
expand.execute();

代码示例来源:origin: ldcsaa/JessMA

/** 获取解压任务对象 */
  @Override
  protected Task getTask()
  {
    Project project    = new Project();
    Expand expand    = getExpand();
    PatternSet ps    = getPatternSet();

    expand.setProject(project);
    expand.setSrc(getSourceFile());
    expand.setDest(getTargetDir());
    expand.setOverwrite(isOverwrite());
    
    if(ps != null)
    {
      ps.setProject(project);
      expand.addPatternset(ps);
    }

    return expand;
  }
}

相关文章