GeoAPI
  1. GeoAPI
  2. GEO-56

Consider the replacement of java.net.URL by java.net.URI

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: feature, metadata
    • Labels:
      None
    • Number of attachments :
      0

      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.

        Issue Links

          Activity

          Hide
          David Zwiers added a comment -

          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.

          Show
          David Zwiers added a comment - 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.
          Hide
          Martin Desruisseaux added a comment -

          (From a David's mail):

          There are some issues with manipulating URI in windows, as drives other than the 'C' drive appear to use a different protocol behind the scenes. This creates some expensive bugs when round tripping to URLs and back (useful for IO operations).

          A warning could be included for potential implementors.

          Show
          Martin Desruisseaux added a comment - (From a David's mail): There are some issues with manipulating URI in windows, as drives other than the 'C' drive appear to use a different protocol behind the scenes. This creates some expensive bugs when round tripping to URLs and back (useful for IO operations). A warning could be included for potential implementors.
          Hide
          Martin Desruisseaux added a comment -

          URL has been replaced by URI for the following interfaces:

          org.opengis.metadata.ApplicationSchemaInformation
          org.opengis.metadata.citation.OnLineResource
          org.opengis.metadata.identification.BrowseGraphic
          org.opengis.parameter.ParameterValue.java

          No change were applied on interfaces in the org.opengis.feature package, since this package need to be revised anyway (it should be the task of a separated JIRA issue).

          Show
          Martin Desruisseaux added a comment - URL has been replaced by URI for the following interfaces: org.opengis.metadata.ApplicationSchemaInformation org.opengis.metadata.citation.OnLineResource org.opengis.metadata.identification.BrowseGraphic org.opengis.parameter.ParameterValue.java No change were applied on interfaces in the org.opengis.feature package, since this package need to be revised anyway (it should be the task of a separated JIRA issue).

            People

            • Assignee:
              Martin Desruisseaux
              Reporter:
              Martin Desruisseaux
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1 hour
                1h
                Remaining:
                Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified