ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Burton" <>
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="" />
> reads a set of properties from a file called "".
>   <property resource="" />
> reads a set of properties from a resource called "".
> 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("") causing it to be loaded
from the CLASSPATH which includes looking inside .jar's in the CLASSPATH.

-Bill Burton

> Thanks,
> Diane
> =====
> (

View raw message