1 package org.apache.axis.tool.core; 2 3 import java.io.File ; 4 5 import org.apache.tools.ant.Project; 6 import org.apache.tools.ant.taskdefs.Copy; 7 import org.apache.tools.ant.types.FileSet; 8 9 24 25 public class FileCopier extends Copy{ 26 public FileCopier() { 27 this.setProject(new Project()); 28 this.getProject().init(); 29 this.setTaskType("copy"); 30 this.setTaskName("copy-files"); 31 this.setOwningTarget(new org.apache.tools.ant.Target()); 32 } 33 34 public void copyFiles(File sourceFile,File destinationDirectory){ 35 36 this.filesets.clear(); 37 38 if (sourceFile.isFile()) 39 this.setFile(sourceFile); 40 else { 41 FileSet fileset = new FileSet(); 42 fileset.setDir(sourceFile); 43 fileset.setIncludes("*/**"); 44 this.addFileset(fileset); 45 } 46 this.setTodir(destinationDirectory); 47 this.perform(); 48 } 49 50 51 } 52 | Popular Tags |