1 11 package org.eclipse.pde.internal.build.ant; 12 13 import java.util.StringTokenizer ; 14 15 18 public class FileSet { 19 20 protected String dir; protected String defaultexcludes; 22 protected String includes; 23 protected String includesfile; 24 protected String excludes; 25 protected String excludesfile; 26 protected String casesensitive; 27 28 39 public FileSet(String dir, String defaultexcludes, String includes, String includesfile, String excludes, String excludesfile, String casesensitive) { 40 this.dir = dir; 41 this.defaultexcludes = defaultexcludes; 42 this.includes = includes; 43 this.includesfile = includesfile; 44 this.excludes = excludes; 45 this.excludesfile = excludesfile; 46 this.casesensitive = casesensitive; 47 } 48 49 54 protected void print(AntScript script) { 55 script.printTab(); 56 script.print("<fileset"); script.printAttribute("dir", dir, true); script.printAttribute("defaultexcludes", defaultexcludes, false); script.printAttribute("includesfile", includesfile, false); script.printAttribute("excludesfile", excludesfile, false); script.printAttribute("casesensitive", casesensitive, false); script.print(">"); script.println(); 64 65 if (includes != null) 66 printNames(script, "include", includes); if (excludes != null) 68 printNames(script, "exclude", excludes); script.println("</fileset>"); } 71 72 private void printNames(AntScript script, String tag, String names) { 73 script.indent++; 74 for (StringTokenizer tokenizer = new StringTokenizer (names, ","); tokenizer.hasMoreTokens();) { script.printTabs(); 76 script.print("<"); script.print(tag); 78 script.printAttribute("name", tokenizer.nextToken().trim(), true); script.print("/>"); script.println(); 81 } 82 script.indent--; 83 } 84 } 85 | Popular Tags |