Issue Type: Improvement Improvement
Affects Versions: 2.3.4, 2.4-beta
Assignee: Andrea Aime
Created: 26/Jul/13 3:52 AM
Description:

ResourcePool.getGridCoverageReader always tries to find a File from the coverageStore url String when the reader is null.
It uses GeoserverDataDirectory.findDataFile utility method which always return a File on top of that String.

There are some cases (as an instance, for custom plugins like ArcSDE or PGRaster automatic configuration I'm working on) where the url is something like this:

sde://user:pass@server:port/instance

or

pgraster://user:pass@server:port:db.schema....@params

In those cases it would be surely bettere if we don't force the URL to be converted to a File and let it as a String so that the underlying GridCoverageReader will know how to properly parse that String.
Also note that, on Windows, doing a new File(String url) may transform
sde://user into sde:\user and pgraster://user into pgraster:\ which won't allow proper parsing anymore, having changed the prefix syntax.

For this reason, I think it would be better if GeoserverDataDirectory.findDataFile returns a File from a String only in case that file really exist; returning null otherwise.
By this way, ResourcePool.getGridCoverageReader may decide whether to pass down to the GridCoverageReader, the returned file (if any) or the url String as is.

I was thinking if instead of changing the ImageMosaicJDBC code to try to parse Files having similar strange path (pgraster://something), we could relax somehow this "force to be a File" behaviour on ResourcePool..
We could probably modify the findDataFile to return a File only in case it really deals with a file:
(file:/ + file: + /some/path/to/something + c:/ + ....) and skip "peculiar" cases like:
myformat://customSyntax.

We can probably think about returning null (as a File, to continue passing down a string) in case we see a "something://" prefix longer than a certain amount of chars (to make sure that C:/ still work)... (Do we risk by this way to improperly parse some peculiar network mapping / protocol I'm unaware of?)

What are your thoughts on this topic?
Please, let me know.
Best Regards,
Daniele

Project: GeoServer
Priority: Minor Minor
Reporter: Daniele Romagnoli
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to