1 17 18 19 20 package org.apache.lenya.cms.ant; 21 22 import java.io.File ; 23 import java.util.List ; 24 import java.util.StringTokenizer ; 25 26 import org.apache.tools.ant.BuildException; 27 import org.apache.tools.ant.taskdefs.Copy; 28 import org.apache.tools.ant.types.FileSet; 29 import org.apache.tools.ant.types.Path; 30 31 45 public class BulkCopyTask extends Copy { 46 47 private Path sourceDirs; 48 49 52 public void execute() throws BuildException { 53 54 final StringTokenizer sourceDirTokens = new StringTokenizer (sourceDirs.toString(), File.pathSeparator); 55 56 while (sourceDirTokens.hasMoreTokens()) { 57 final String sourceDir = sourceDirTokens.nextToken(); 58 59 for(int i=0; i<getFileSets().size(); i++) 60 ((FileSet) getFileSets().get(i)).setDir(new File (sourceDir)); 61 62 super.execute(); 63 } 64 } 65 66 69 public void setSourceDirs(Path sourceDirs) { 70 this.sourceDirs = sourceDirs; 71 } 72 73 76 private List getFileSets() { 77 return super.filesets; 78 } 79 } 80 | Popular Tags |