You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by mb...@apache.org on 2005/05/31 21:18:55 UTC

cvs commit: ant/docs/manual/CoreTypes resources.html

mbenson     2005/05/31 12:18:55

  Modified:    src/main/org/apache/tools/ant/types/resources
                        FileResource.java
               src/etc/testcases/types/resources/selectors build.xml
               docs/manual/CoreTypes resources.html
  Log:
  Renamed <file> resource's "base" attribute to "basedir",
  for consistency / familiarity.
  
  Revision  Changes    Path
  1.2       +15 -15    ant/src/main/org/apache/tools/ant/types/resources/FileResource.java
  
  Index: FileResource.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/resources/FileResource.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FileResource.java	23 May 2005 19:51:57 -0000	1.1
  +++ FileResource.java	31 May 2005 19:18:55 -0000	1.2
  @@ -40,7 +40,7 @@
           = Resource.getMagicNumber("null file".getBytes());
   
       private File file;
  -    private File base;
  +    private File baseDir;
   
       /**
        * Default constructor.
  @@ -49,13 +49,13 @@
       }
   
       /**
  -     * Construct a new FileResource using the specified base File and relative name.
  -     * @param b      the base File (directory).
  +     * Construct a new FileResource using the specified basedir and relative name.
  +     * @param b      the basedir as File.
        * @param name   the relative filename.
        */
       public FileResource(File b, String name) {
           setFile(FILE_UTILS.resolveFile(b, name));
  -        setBase(b);
  +        setBaseDir(b);
       }
   
       /**
  @@ -95,21 +95,21 @@
       }
   
       /**
  -     * Set the base File for this FileResource.
  -     * @param b the base File.
  +     * Set the basedir for this FileResource.
  +     * @param b the basedir as File.
        */
  -    public void setBase(File b) {
  +    public void setBaseDir(File b) {
           checkAttributesAllowed();
  -        base = b;
  +        baseDir = b;
       }
   
       /**
  -     * Return the base to which the name is relative.
  -     * @return the base File.
  +     * Return the basedir to which the name is relative.
  +     * @return the basedir as File.
        */
  -    public File getBase() {
  +    public File getBaseDir() {
           return isReference()
  -            ? ((FileResource) getCheckedRef()).getBase() : base;
  +            ? ((FileResource) getCheckedRef()).getBaseDir() : baseDir;
       }
   
       /**
  @@ -117,21 +117,21 @@
        * @param r the Reference to set.
        */
       public void setRefid(Reference r) {
  -        if (file != null || base != null) {
  +        if (file != null || baseDir != null) {
               throw tooManyAttributes();
           }
           super.setRefid(r);
       }
   
       /**
  -     * Get the name of this FileResource relative to its base, if any.
  +     * Get the name of this FileResource relative to its baseDir, if any.
        * @return the name of this resource.
        */
       public String getName() {
           if (isReference()) {
               return ((Resource) getCheckedRef()).getName();
           }
  -        File b = getBase();
  +        File b = getBaseDir();
           return b == null ? getNotNullFile().getAbsolutePath()
               : FILE_UTILS.removeLeadingPath(b, getNotNullFile());
       }
  
  
  
  1.2       +1 -1      ant/src/etc/testcases/types/resources/selectors/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/ant/src/etc/testcases/types/resources/selectors/build.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- build.xml	23 May 2005 19:51:58 -0000	1.1
  +++ build.xml	31 May 2005 19:18:55 -0000	1.2
  @@ -31,7 +31,7 @@
                 <resources>
                   <file file="foo" />
                   <resource name="foo" />
  -                <file file="foo" base="${basedir}" />
  +                <file file="foo" basedir="${basedir}" />
                 </resources>
                 <rsel:name name="foo" />
               </restrict>
  
  
  
  1.2       +1 -1      ant/docs/manual/CoreTypes/resources.html
  
  Index: resources.html
  ===================================================================
  RCS file: /home/cvs/ant/docs/manual/CoreTypes/resources.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- resources.html	23 May 2005 19:51:56 -0000	1.1
  +++ resources.html	31 May 2005 19:18:55 -0000	1.2
  @@ -87,7 +87,7 @@
       <td align="center" valign="top">Yes</td>
     </tr>
     <tr>
  -    <td valign="top">base</td>
  +    <td valign="top">basedir</td>
       <td valign="top">The base directory of this resource.  When this
         attribute is set, attempts to access the name of the resource
         will yield a path relative to this location.</td>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org