ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <>
Subject FileUtils.normalize
Date Fri, 18 Feb 2005 18:54:22 GMT
This method will:

    * Uppercase the drive letter if there is one.
    * Remove redundant slashes after the drive spec.
    * Resolve all ./, .\, ../ and ..\ sequences.
    * DOS style paths that start with a drive letter
will have \ as the separator.

Other DOS considerations:

when a drive letter is supplied and there is no
separator immediately following, the meaning is
different.  Supplying the separator here yields the
wrong filename.  In this case the meaning is that the
remaining filename beyond the colon is relative to the
current directory for that drive.  As we resolve . and
.. components of the filename, I think we should be
resolving this to the full path intended.

when a single separator leads the path, the path is
relative to the root of the current directory.  I
think we should be resolving that directory as well to
be pointing to the correct file.

OR it may be that we should detect these conditions as
NOT being absolute pathnames on DOS. 
File.isAbsolute() returns false in these cases. 
However, we should still provide some means of
obtaining the absolute forms of these names as well.

The only reason I bring it up rather than just making
the necessary changes is (1) that there is a choice of
which to do, and (2) that the first alternative will
break existing testcases (Project.testResolveFile at
least).  No idea what the second (possibly more
correct) alternative will break.



Do you Yahoo!? 
The all-new My Yahoo! - What will yours do? 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message