1 16 17 package org.apache.jk.ant; 18 19 import java.io.File ; 20 21 import org.apache.tools.ant.util.GlobPatternMapper; 22 23 public class Source { 24 File dir; 25 String localPart; 26 27 public Source( File dir, String localPart ) { 28 this.dir=dir; 29 this.localPart=localPart; 30 } 31 32 public String getTargetFile( GlobPatternMapper mapper ) { 33 String targetNA[]=mapper.mapFileName( localPart ); 34 if( targetNA==null ) 35 return null; String target=targetNA[0]; 37 return target; 38 } 39 40 public File getFile() { 41 return new File ( dir, localPart ); 42 } 43 44 public String getPackage() { 45 int lastSlash=localPart.lastIndexOf("/"); 46 if( lastSlash==-1 ) 47 return ""; 48 return localPart.substring( 0, lastSlash ); 49 } 50 } 51 | Popular Tags |