--- Stephen McConnell <[EMAIL PROTECTED]> wrote:

>  
> 
> > -----Original Message-----
> > From: Matt Benson [mailto:[EMAIL PROTECTED] 
> > Sent: Tuesday, 26 September 2006 4:17 AM
> > To: Ant Developers List
> > Subject: Re: Resource.getURL()
> > 
> > --- Dominique Devienne <[EMAIL PROTECTED]>
> wrote:
> > 
> > > > A URLResource could then be created using:
> > > > new URLResource( name, uri,
> > > > handlerClassResourceName );
> > > >
> > > > The upside of this approach is the elimination
> of
> > > > the entire subject of system classloader
> mutation,
> > > > and a framework for binding custom handlers
> > > > (which resolves some of the earlier issues
> raised
> > > > in this thread).
> > > 
> > > I have no issue whatsoever with this Steve :-) 
> --DD
> > 
> > The problem with this approach--specifying the
> handler 
> > classname to the URLResource constructor--is that
> it fails to 
> > address the primary requirement that Ant have a
> predictable 
> > way to resolve a string representation of a
> Resource to a 
> > properly configured Resource implementation.  :(
> 
> Matt:
> 
> Can you expand on what you mean by "a string
> representation of a Resource"?
> Are your implying something equivalent to the way a
> URL can be externalized
> to a string (which could be done if all resources
> are associated with
> dedicated url handlers).  Some concrete usage
> examples would be handy.
> 
> /Steve.

Exactly.  Take for example the echo task.  It defines
a method like
public void setFile(File).
Ant knows how to resolve file="somefile" to a File
object.  Resources' OutputStream is hardly used at
present; the concept behind its (OutputStream's)
addition to the API is:

<echo to="property:foo">bar</echo>

I used "to" here; maybe the right name is "toresource"
or simply "resource" as is "file".  The implementation
of setFile(File f) would be:

setTo(new FileResource(f));

This is the exact use case driving this, from my
perspective anyway.  It should be solvable, as you
mention, using either application-level
pseudo-protocols or custom protocol handlers.  But
without this functionality I will consider any
solution incomplete.

-Matt

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to