Task #3373
If id contains "/", the MNode.getSysteMetadata method fails.
0%
Description
I have a very simple code:
Identifier id = new Identifier();
id.setValue(identifier);
activeMNode.getSystemMetadata(id);
When I test it, if the id has a "/", e.g., doi:10.6085/AA/YBHX00_XXXITBDXMMR01_20040720.50.5
The test fails:
[junit] - rest call info: GET https://mn-demo-5.test.dataone.org/knb/d1/mn/v1/meta/doi:10.6085%2FAA%2FYBHX00_XXXITBDXMMR01_20040720.50.5
[junit] - response httpCode: 400
400: Bad Request: Deserializing Text/Plain: Just providing message body:
{EndOfMessage}
org.dataone.service.exceptions.ServiceFailure: 400: Bad Request: Deserializing Text/Plain: Just providing message body:
{EndOfMessage}
at org.dataone.service.util.ExceptionHandler.deserializeTextPlainAndThrowException(ExceptionHandler.java:470)
at org.dataone.service.util.ExceptionHandler.deserializeAndThrowException(ExceptionHandler.java:379)
at org.dataone.service.util.ExceptionHandler.deserializeAndThrowException(ExceptionHandler.java:314)
at org.dataone.service.util.ExceptionHandler.filterErrors(ExceptionHandler.java:108)
at org.dataone.client.D1RestClient.doGetRequest(D1RestClient.java:234)
at org.dataone.client.D1RestClient.doGetRequest(D1RestClient.java:223)
at org.dataone.client.D1Node.getSystemMetadata(D1Node.java:562)
at org.dataone.client.D1Node.getSystemMetadata(D1Node.java:493)
at org.dataone.client.MNode.getSystemMetadata(MNode.java:322)
at edu.ucsb.nceas.morpho.datastore.DataONEDataStoreService.exists(DataONEDataStoreService.java:506)
at edu.ucsb.nceas.morphotest.datastore.DataONEDataStoreServiceTest.testExists(DataONEDataStoreServiceTest.java:70)
If there is no "/" in the identifier, it works.
I believe the getSystemMetadata should handle the id with "/" correctly.