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

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

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

Expand.addPatternset介绍

[英]Add a patternset.
[中]添加一个图案集。

代码示例

代码示例来源:origin: jenkinsci/jenkins

  1. private static void unzipExceptClasses(File archive, File destDir, Project prj) {
  2. Expand e = new Expand();
  3. e.setProject(prj);
  4. e.setTaskType("unzip");
  5. e.setSrc(archive);
  6. e.setDest(destDir);
  7. PatternSet p = new PatternSet();
  8. p.setExcludes("WEB-INF/classes/");
  9. e.addPatternset(p);
  10. e.execute();
  11. }

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

  1. private Expand createExpand(File jarFile)
  2. {
  3. String outputDir = expandDir + File.separator + jarFile.getName();
  4. Project prj = new Project();
  5. FileSet fileSet = createFileSetForJarFile(jarFile, prj);
  6. PatternSet patternSet = createPatternSet(prj);
  7. Expand expand = new Expand();
  8. expand.setProject(prj);
  9. expand.setOverwrite(true);
  10. expand.setDest(new File(outputDir));
  11. expand.addFileset(fileSet);
  12. expand.addPatternset(patternSet);
  13. return expand;
  14. }

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

  1. private static void unzipExceptClasses(File archive, File destDir, Project prj) {
  2. Expand e = new Expand();
  3. e.setProject(prj);
  4. e.setTaskType("unzip");
  5. e.setSrc(archive);
  6. e.setDest(destDir);
  7. PatternSet p = new PatternSet();
  8. p.setExcludes("WEB-INF/classes/");
  9. e.addPatternset(p);
  10. e.execute();
  11. }

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

  1. private void extractZip(final File source, final File target) throws BuildException
  2. {
  3. final Expand e = new Expand();
  4. e.setProject(getProject());
  5. e.setOverwrite(false);
  6. if (excludeManifest)
  7. {
  8. final PatternSet ps = new PatternSet();
  9. ps.setExcludes("META-INF,META-INF/MANIFEST.MF"); //NOI18N
  10. e.addPatternset(ps);
  11. }
  12. e.setSrc(source);
  13. e.setDest(target);
  14. e.execute();
  15. }

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

  1. private void extractZip(final File source, final File target) throws BuildException
  2. {
  3. final Expand e = new Expand();
  4. e.setProject(getProject());
  5. e.setOverwrite(false);
  6. if (excludeManifest)
  7. {
  8. final PatternSet ps = new PatternSet();
  9. ps.setExcludes("META-INF,META-INF/MANIFEST.MF"); //NOI18N
  10. e.addPatternset(ps);
  11. }
  12. e.setSrc(source);
  13. e.setDest(target);
  14. e.execute();
  15. }

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

  1. /** 获取解压任务对象 */
  2. @Override
  3. protected Task getTask()
  4. {
  5. Project project = new Project();
  6. Expand expand = getExpand();
  7. PatternSet ps = getPatternSet();
  8. expand.setProject(project);
  9. expand.setSrc(getSourceFile());
  10. expand.setDest(getTargetDir());
  11. expand.setOverwrite(isOverwrite());
  12. if(ps != null)
  13. {
  14. ps.setProject(project);
  15. expand.addPatternset(ps);
  16. }
  17. return expand;
  18. }
  19. }

相关文章