ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wannheden, Knut" <knut.wannhe...@paranor.ch>
Subject FileUtils#normalize(File)
Date Mon, 28 Jul 2003 10:33:40 GMT
I've noticed that the normalize(File) method in FileUtils requires that the
File to normalize is absolute.  I was wondering what the reason is for this
reason.  Would it be too complex to normalize a relative path on Windows
systems?

I think it makes perfectly sense to normalize a path like "./foo" into "foo"
or "foo/bar/.." into "foo".  Even a path like "../foo" could be normalized
using the system property "user.dir", but it could also cause an Exception
to be thrown as the absolute path "/../foo" would (a Unix system would even
normalize that as "/foo").

The reason I'm askin is because I wanted to reuse the code in normalize
which handles ".." and "." path segments.  But maybe I should copy and paste
instead.

--
knut

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message