Details
Description
The following methods returns an URL:
- org.opengis.feature.FeatureStore.getIcon();
- org.opengis.feature.FeatureStoreFactory.getIcon();
- org.opengis.metadata.ApplicationSchemaInformation.getSchemaAscii();
- org.opengis.metadata.ApplicationSchemaInformation.getGraphicsFile();
- org.opengis.metadata.ApplicationSchemaInformation.getSoftwareDevelopmentFile();
- org.opengis.metadata.citation.OnlineResource.getLinkage();
- org.opengis.metadata.identification.BrowseGraphic.getFileName();
- org.opengis.parameter.ParameterValue.valueFile();
URL was choosen instead of URI because at the time the GeoAPI project started, it was targeting J2SE 1.3. If we are switching to J2SE 1.4, should we consider the replacement of URL by URI? It is more general, and can also solve a performance bootleneck. It has been reported that usage of URL.equals(...) in some implementation was a problem, because URL calls the name resolver, which can be fairly slow.
I found some inconsistencies between URL and URI.
URI version1 = new URI();
URI version2 = version1.toURL().toURI(); // or something along these lines
assert(version1.equals(version2)); //will fail
This occurs when a protocol is resolved which may be non-local, but appears local, for example D: on windows.