ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julian M. Savage" <>
Subject Re: [patch] absolute/relative paths
Date Wed, 14 Feb 2001 15:34:11 GMT
I don't know the answer to that question, but I do know that it's actually
more work to get the canonical path than to get the absolute path, because
File.getCanonicalPath() throws an exception which must be caught, and
absolute path doesn't. This makes me think that the original author must
have had some good reason for deciding on getCanonicalPath rather than
getAbsolutePath. The code falls back to getAbsolutePath in the case where
getCanonicalPath throws an exception. There are other calls which my patch
does not address, such as when getting the path of the build file (in some
cases it would not even be possible to invoke Project.resolveFile() because
they are made before the project object is created. In cases where it looked
like it made sense for me to do so I changed the code from calling
getCanonicalPath directly to calling it via the Project.resolveFile() call,
which then means for those cases that I changed my new logic is always

I don't mind whether the behavior is the default or not, and I am not sure
that my solution is the best one, but this patch is in place on my system
and resolves the problem for me. It may require reworking by someone who
understands better the workings of the entire system before it can be put
into place by a commiter.


----- Original Message -----
From: "Jesse Glick" <>
To: <>
Sent: Wednesday, February 14, 2001 9:49 PM
Subject: Re: [patch] absolute/relative paths

> "Julian M. Savage" wrote:
> > [snip]
> > This patch solves my problem; if you set a property
> > "ant.project.useabsolute" then Project.resolveFile() will use
> > getAbsolutePath() rather than getCanonical().
> Should this behavior even be optional and not the default? Is there any
> reason why you would want Ant to canonicalize symlinks to begin with?
> -Jesse
> --
> Jesse Glick   <>
> NetBeans, Open APIs  <>
> tel (+4202) 3300-9161 Sun Micro x49161 Praha CR
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message