1 package org.apache.axis.tool.core; 2 3 import java.io.File ; 4 import java.io.IOException ; 5 6 import org.apache.tools.ant.Project; 7 import org.apache.tools.ant.taskdefs.Jar; 8 9 24 public class JarFileWriter extends Jar{ 25 26 27 public JarFileWriter() { 28 this.setProject(new Project()); 29 this.getProject().init(); 30 this.setTaskType("jar"); 31 this.setTaskName("jar"); 32 this.setOwningTarget(new org.apache.tools.ant.Target()); 33 } 34 35 public void writeJarFile(File outputFolder,String outputFileName,File inputFileFolder) throws IOException ,Exception { 36 37 if (!outputFolder.exists()){ 38 outputFolder.mkdir(); }else{ 40 if (!outputFolder.isDirectory()) 41 return; 42 } 43 44 File targetFile = new File (outputFolder,outputFileName); 45 this.setBasedir(inputFileFolder); 46 this.setDestFile(targetFile); 47 48 this.perform(); 50 51 52 } 53 54 55 } 56 | Popular Tags |