Revision 5674
Added by berkley about 14 years ago
src/edu/ucsb/nceas/metacat/restservice/ResourceHandler.java | ||
---|---|---|
1440 | 1440 |
object = new FileInputStream(parts.get("object")); |
1441 | 1441 |
sysmeta = new FileInputStream(parts.get("sysmeta")); |
1442 | 1442 |
|
1443 |
String obj = IOUtils.toString(object); |
|
1443 |
/*String obj = IOUtils.toString(object);
|
|
1444 | 1444 |
String sm = IOUtils.toString(sysmeta); |
1445 | 1445 |
System.out.println("object: " + obj); |
1446 | 1446 |
System.out.println("sm: " + sm); |
1447 | 1447 |
object = IOUtils.toInputStream(obj); |
1448 |
sysmeta = IOUtils.toInputStream(sm); |
|
1448 |
sysmeta = IOUtils.toInputStream(sm);*/ |
|
1449 |
|
|
1449 | 1450 |
} |
1450 | 1451 |
catch(IOException ioe) |
1451 | 1452 |
{ |
... | ... | |
1472 | 1473 |
cs.setParamsFromRequest(request); |
1473 | 1474 |
Identifier id = new Identifier(); |
1474 | 1475 |
id.setValue(guid); |
1475 |
cs.create(token, id, object, m); |
|
1476 |
Identifier rId = cs.create(token, id, object, m); |
|
1477 |
serializeServiceType(Identifier.class, rId, out); |
|
1476 | 1478 |
|
1477 | 1479 |
} else if (action.equals(FUNCTION_NAME_UPDATE)) { //handle updates |
1478 | 1480 |
IdentifierManager im = IdentifierManager.getInstance(); |
... | ... | |
1510 | 1512 |
{ |
1511 | 1513 |
cs.setParamsFromRequest(request); |
1512 | 1514 |
Identifier rId = cs.update(token, id, object, obsoletedGuid, m); |
1515 |
serializeServiceType(Identifier.class, rId, out); |
|
1513 | 1516 |
} |
1514 | 1517 |
catch(NotFound e) |
1515 | 1518 |
{ |
... | ... | |
1521 | 1524 |
} |
1522 | 1525 |
|
1523 | 1526 |
//clean up the MMP files |
1524 |
//parts.get("sysmeta").delete();
|
|
1525 |
//parts.get("object").delete();
|
|
1527 |
parts.get("sysmeta").delete(); |
|
1528 |
parts.get("object").delete(); |
|
1526 | 1529 |
} catch (NotAuthorized e) { |
1527 | 1530 |
response.setStatus(500); |
1528 | 1531 |
serializeException(e, out); |
... | ... | |
1567 | 1570 |
{ |
1568 | 1571 |
if(parts != null) |
1569 | 1572 |
{ |
1570 |
//parts.get("sysmeta").delete();
|
|
1571 |
//parts.get("object").delete();
|
|
1573 |
parts.get("sysmeta").delete(); |
|
1574 |
parts.get("object").delete(); |
|
1572 | 1575 |
} |
1573 | 1576 |
} |
1574 | 1577 |
} |
Also available in: Unified diff
return the identifier object instead of nothing