Revision 6279
Added by ben leinfelder over 13 years ago
src/edu/ucsb/nceas/metacat/restservice/CNResourceHandler.java | ||
---|---|---|
611 | 611 |
* @throws JiBXException |
612 | 612 |
*/ |
613 | 613 |
private void reserve() throws InvalidToken, ServiceFailure, NotAuthorized, IdentifierNotUnique, NotImplemented, InvalidRequest, IOException, JiBXException { |
614 |
String id = params.get("pid")[0]; |
|
615 |
String format = params.get("format")[0]; |
|
616 |
String scope = params.get("scope")[0]; |
|
617 |
Identifier pid = new Identifier(); |
|
618 |
pid.setValue(id); |
|
614 |
Identifier pid = null; |
|
615 |
String scope = null; |
|
616 |
String format = null; |
|
617 |
// gather the params |
|
618 |
try { |
|
619 |
String id = params.get("pid")[0]; |
|
620 |
pid = new Identifier(); |
|
621 |
pid.setValue(id); |
|
622 |
} catch (Exception e) { |
|
623 |
logMetacat.warn("pid not specified"); |
|
624 |
} |
|
625 |
try { |
|
626 |
scope = params.get("scope")[0]; |
|
627 |
} catch (Exception e) { |
|
628 |
logMetacat.warn("pid not specified"); |
|
629 |
} |
|
630 |
try { |
|
631 |
format = params.get("format")[0]; |
|
632 |
} catch (Exception e) { |
|
633 |
logMetacat.warn("pid not specified"); |
|
634 |
} |
|
635 |
// call the implementation |
|
619 | 636 |
Identifier retPid = CNodeService.getInstance().reserveIdentifier(session, pid, scope, format); |
620 | 637 |
OutputStream out = response.getOutputStream(); |
621 | 638 |
response.setStatus(200); |
Also available in: Unified diff
allow parameters to be omitted in reserveIdentifier handling