Revision 5927
Added by berkley almost 14 years ago
src/edu/ucsb/nceas/metacat/restservice/ResourceHandler.java | ||
---|---|---|
1595 | 1595 |
logMetacat.debug("Disassembling MIME multipart form"); |
1596 | 1596 |
InputStream object = null; |
1597 | 1597 |
InputStream sysmeta = null; |
1598 |
Map<String, List<String>> mutlipartparams; |
|
1598 | 1599 |
|
1599 | 1600 |
try |
1600 | 1601 |
{ |
... | ... | |
1625 | 1626 |
throw new ServiceFailure("1202", "No file keys found in MMP. " + |
1626 | 1627 |
"create/update must have multipart files with names 'object' and 'sysmeta'"); |
1627 | 1628 |
} |
1628 |
Iterator keys = files.keySet().iterator(); |
|
1629 |
System.out.println("iterating through multipart files: " + keys); |
|
1630 |
while(keys.hasNext()) |
|
1629 |
Iterator multipartkeys = files.keySet().iterator();
|
|
1630 |
System.out.println("iterating through multipart files: " + multipartkeys);
|
|
1631 |
while(multipartkeys.hasNext())
|
|
1631 | 1632 |
{ |
1632 |
String key = (String)keys.next(); |
|
1633 |
String key = (String)multipartkeys.next();
|
|
1633 | 1634 |
System.out.println("files key: " + key); |
1634 | 1635 |
System.out.println("files value: " + files.get(key)); |
1635 | 1636 |
} |
1636 | 1637 |
|
1637 |
Map<String, List<String>> params = mr.getMultipartParameters(); |
|
1638 |
keys = params.keySet().iterator(); |
|
1638 |
mutlipartparams = mr.getMultipartParameters(); |
|
1639 |
multipartkeys = mutlipartparams.keySet().iterator(); |
|
1640 |
while(multipartkeys.hasNext()) |
|
1641 |
{ |
|
1642 |
String key = (String)multipartkeys.next(); |
|
1643 |
System.out.println("mutlipartparams key: " + key); |
|
1644 |
System.out.println("mutlipartparams value: " + mutlipartparams.get(key)); |
|
1645 |
} |
|
1646 |
|
|
1647 |
Iterator keys = params.keySet().iterator(); |
|
1639 | 1648 |
while(keys.hasNext()) |
1640 | 1649 |
{ |
1641 | 1650 |
String key = (String)keys.next(); |
1642 |
System.out.println("params key: " + key);
|
|
1643 |
System.out.println("params value: " + params.get(key));
|
|
1651 |
System.out.println("param key: " + key); |
|
1652 |
System.out.println("param value: " + params.get(key)); |
|
1644 | 1653 |
} |
1654 |
|
|
1645 | 1655 |
File smFile = files.get("sysmeta"); |
1646 | 1656 |
System.out.println("smFile: " + smFile.getAbsolutePath()); |
1647 | 1657 |
sysmeta = new FileInputStream(smFile); |
... | ... | |
1703 | 1713 |
AuthToken token = new AuthToken(sessionId); |
1704 | 1714 |
|
1705 | 1715 |
//do some checks |
1706 |
if(params.get("obsoletedGuid") == null) |
|
1716 |
if(mutlipartparams.get("obsoletedGuid") == null)
|
|
1707 | 1717 |
{ |
1708 | 1718 |
throw new InvalidRequest("1202", "obsoletedGuid must be contained in the request parameters."); |
1709 | 1719 |
} |
1710 | 1720 |
//get the obsoletedGuid |
1711 |
String[] obsGuidS = params.get("obsoletedGuid");
|
|
1712 |
obsoletedGuid.setValue(obsGuidS[0]);
|
|
1721 |
String obsGuidS = mutlipartparams.get("obsoletedGuid").get(0);
|
|
1722 |
obsoletedGuid.setValue(obsGuidS); |
|
1713 | 1723 |
|
1714 | 1724 |
if (!im.identifierExists(obsoletedGuid.getValue())) |
1715 | 1725 |
{ |
Also available in: Unified diff
fixed update problem