You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by mb...@apache.org on 2008/07/16 19:23:26 UTC

svn commit: r677352 - /ant/core/trunk/src/main/org/apache/tools/ant/types/resources/FileResource.java

Author: mbenson
Date: Wed Jul 16 10:23:25 2008
New Revision: 677352

URL: http://svn.apache.org/viewvc?rev=677352&view=rev
Log:
convenience constructor

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/types/resources/FileResource.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/resources/FileResource.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/FileResource.java?rev=677352&r1=677351&r2=677352&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/resources/FileResource.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/resources/FileResource.java Wed Jul 16 10:23:25 2008
@@ -70,14 +70,24 @@
     }
 
     /**
+     * Create a new FileResource.
+     * @param p Project
+     * @param f File represented
+     * @since Ant 1.8
+     */
+    public FileResource(Project p, File f) {
+        setProject(p);
+        setFile(f);
+    }
+
+    /**
      * Constructor for Ant attribute introspection.
      * @param p the Project against which to resolve <code>s</code>.
      * @param s the absolute or Project-relative filename as a String.
      * @see org.apache.tools.ant.IntrospectionHelper
      */
     public FileResource(Project p, String s) {
-        this(p.resolveFile(s));
-        setProject(p);
+        this(p, p.resolveFile(s));
     }
 
     /**