ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Burton" <bi...@progress.com>
Subject Re: "resource" vs. "file" in <property> task
Date Thu, 21 Dec 2000 00:22:30 GMT
Hello Diane,

Diane Holt wrote:
> 
> >From the doc:
>   <property file="foo.properties" />
> reads a set of properties from a file called "foo.properties".
> 
>   <property resource="foo.properties" />
> reads a set of properties from a resource called "foo.properties".
> 
> What's the difference between a "resource" and "file"?

This confused me too as the docs aren't clear on the distinction so I
looked at the source to get the answer.  The file attribute does what you
would expect and loads a file from the file system.  The resource
attribute also loads a file but finds the file by calling
getClass().getResourceAsStream("foo.properties") causing it to be loaded
from the CLASSPATH which includes looking inside .jar's in the CLASSPATH.

-Bill Burton

> 
> Thanks,
> Diane
> 
> =====
> (holtdl@yahoo.com)

Mime
View raw message