1 18 package org.apache.tools.ant.taskdefs.optional.extension.resolvers; 19 20 import java.io.File ; 21 import org.apache.tools.ant.BuildException; 22 import org.apache.tools.ant.Project; 23 import org.apache.tools.ant.taskdefs.optional.extension.Extension; 24 import org.apache.tools.ant.taskdefs.optional.extension.ExtensionResolver; 25 26 30 public class LocationResolver implements ExtensionResolver { 31 private String location; 32 33 37 public void setLocation(final String location) { 38 this.location = location; 39 } 40 41 48 public File resolve(final Extension extension, 49 final Project project) throws BuildException { 50 if (null == location) { 51 final String message = "No location specified for resolver"; 52 throw new BuildException(message); 53 } 54 55 return project.resolveFile(location); 56 } 57 61 public String toString() { 62 return "Location[" + location + "]"; 63 } 64 } 65 | Popular Tags |