ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/util FileUtils.java
Date Mon, 31 Jan 2005 23:50:49 GMT
mbenson     2005/01/31 15:50:48

  Modified:    src/main/org/apache/tools/ant/util Tag: ANT_16_BRANCH
                        FileUtils.java
  Log:
  Merge
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.56.2.9  +8 -4      ant/src/main/org/apache/tools/ant/util/FileUtils.java
  
  Index: FileUtils.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/FileUtils.java,v
  retrieving revision 1.56.2.8
  retrieving revision 1.56.2.9
  diff -u -r1.56.2.8 -r1.56.2.9
  --- FileUtils.java	26 Jan 2005 17:31:04 -0000	1.56.2.8
  +++ FileUtils.java	31 Jan 2005 23:50:48 -0000	1.56.2.9
  @@ -713,7 +713,7 @@
        * @param filename the file name to be checked for being an absolute path.
        * @return true if the filename represents an absolute path.
        */
  -    private static boolean isAbsolutePath(String filename) {
  +    public static boolean isAbsolutePath(String filename) {
           if (filename.startsWith(File.separator)) {
               // common for all os
               return true;
  @@ -1164,8 +1164,12 @@
        */
       public boolean isSymbolicLink(File parent, String name)
           throws IOException {
  -        File toTest = new File(((parent == null)
  -            ? null : parent.getCanonicalPath()), name);
  +        if (parent == null) {
  +            File f = new File(name);
  +            parent = f.getParentFile();
  +            name = f.getName();
  +        }
  +        File toTest = new File(parent.getCanonicalPath(), name);
           return !toTest.getAbsolutePath().equals(toTest.getCanonicalPath());
       }
   
  
  
  

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


Mime
View raw message