ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject RE: Resource.getURL()
Date Mon, 25 Sep 2006 20:58:12 GMT

--- Stephen McConnell <mcconnell@dpml.net> wrote:

>  
> 
> > -----Original Message-----
> > From: Matt Benson [mailto:gudnabrsam@yahoo.com] 
> > Sent: Tuesday, 26 September 2006 4:17 AM
> > To: Ant Developers List
> > Subject: Re: Resource.getURL()
> > 
> > --- Dominique Devienne <ddevienne@gmail.com>
> 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: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message