opencadc / caom2

Common Archive Observation Model
GNU Affero General Public License v3.0
5 stars 11 forks source link

PublisherID constructor URI arg produces odd resource ID #51

Closed at88mph closed 6 years ago

at88mph commented 6 years ago

The PublisherID constructor in caom2 with the URI argument constructs a resourceID from the path of the argument. However, the URI.getPath() contains the leading slash, which produces the following:

final PublisherID publisherID = new PublisherID(URI.create(PublisherID.SCHEME + "://com.myauth/MYCOLLECTION?OBSID/PRODID"));
System.out(publisherID.getResourceID()) // << Outputs ivo://com.myauth//MYCOLLECTION

The double slash MAY not be a problem for some parsers, but breaks tests.

at88mph commented 6 years ago

Pull request submitted.