I wonder if a third alternative would be to utilize the URIResolver apis
already present in the jdk. If I am not mistaken the app-schema folks use
this to solive this same problem. Maybe Ben or Rini can comment on that.

At what point are the schemas downloaded? Are they done by the underlying
xml parser, or by the geotools xml code?




On Tue, Feb 5, 2013 at 6:28 AM, Andrea Aime <andrea.a...@geo-solutions.it>wrote:

> On Tue, Feb 5, 2013 at 12:43 PM, Mauro Bartolomeoli <
> mauro.bartolome...@geo-solutions.it> wrote:
>
>> I have two options:
>>  * simplest one: SchemaFactory looks in classpath for schemas.properties
>> files containing uri -> localpath bindings used for preloading and caching
>> schemas. The content of schema.properties would be similar to this one:
>>
>> http://www.w3.org/2001/xml.xsd=xml.xsd
>>
>>  * more extensible one: a new interface SchemaLoader could be introduced.
>> to delegate schema loading; the interface will have two methods:
>>   - boolean canLoad(URL url)
>>   - Schema loadSchema(URL url)
>>    SchemaLoader implementation will be looked up with the SPI method
>> during startup and used to load schemas when needed.
>>
>
> Either option works for me, both are pluggable in some sense, the second
> is more general in that it would allow building a Schema
> out of non local classpath sources, but it's also more work for the
> implementor as they have to also build the Schema.
> Another option could be to have a simpler interface:
>
> SchemaLoader { URL replaceSchemaLocation(URL location) }
>
> That would either return null if it cannot manage that schema, or a
> separate URL if it has
> a better source (such as classpath or local file system).
>
> Cheers
> Andrea
>
> --
> ==
> Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
> information.
> ==
>
> Ing. Andrea Aime
> @geowolf
> Technical Lead
>
> GeoSolutions S.A.S.
> Via Poggio alle Viti 1187
> 55054  Massarosa (LU)
> Italy
> phone: +39 0584 962313
> fax: +39 0584 1660272
> mob: +39  339 8844549
>
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
>
> -------------------------------------------------------
>
>
> ------------------------------------------------------------------------------
> Free Next-Gen Firewall Hardware Offer
> Buy your Sophos next-gen firewall before the end March 2013
> and get the hardware for free! Learn more.
> http://p.sf.net/sfu/sophos-d2d-feb
> _______________________________________________
> GeoTools-Devel mailing list
> GeoTools-Devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>
>


-- 
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to