Browse Source

make Project a resource factory for convenience

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@349626 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 19 years ago
parent
commit
2f05511dfc
1 changed files with 13 additions and 1 deletions
  1. +13
    -1
      src/main/org/apache/tools/ant/Project.java

+ 13
- 1
src/main/org/apache/tools/ant/Project.java View File

@@ -41,6 +41,9 @@ import org.apache.tools.ant.types.FilterSet;
import org.apache.tools.ant.types.FilterSetCollection;
import org.apache.tools.ant.types.Description;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.types.Resource;
import org.apache.tools.ant.types.ResourceFactory;
import org.apache.tools.ant.types.resources.FileResource;
import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.ant.util.JavaEnvUtils;
import org.apache.tools.ant.util.StringUtils;
@@ -56,7 +59,7 @@ import org.apache.tools.ant.util.StringUtils;
* file paths at runtime.
*
*/
public class Project {
public class Project implements ResourceFactory {
/** Message priority of "error". */
public static final int MSG_ERR = 0;
/** Message priority of "warning". */
@@ -2187,4 +2190,13 @@ public class Project {
// is private/protected.
}
}

/**
* Resolve the file realtive to the project's basedir and return it as a
* FileResource.
* @since Ant 1.7
*/
public Resource getResource(String name) {
return new FileResource(getBaseDir(), name);
}
}

Loading…
Cancel
Save