Revision 5844
Added by berkley almost 14 years ago
src/edu/ucsb/nceas/metacat/restservice/ResourceHandler.java | ||
---|---|---|
633 | 633 |
File tmpDir = getTempDirectory(); |
634 | 634 |
File tmpSMFile = new File(tmpDir + |
635 | 635 |
".sysmeta." + new Date().getTime() + ".tmp"); |
636 |
System.out.println("1");
|
|
636 |
System.out.println("temp dir: " + tmpDir.getAbsolutePath());
|
|
637 | 637 |
MultipartRequestResolver mrr = new MultipartRequestResolver(tmpDir.getAbsolutePath()); |
638 |
System.out.println("2"); |
|
639 | 638 |
MultipartRequest mr = mrr.resolveMultipart(request); |
640 |
System.out.println("3"); |
|
641 | 639 |
Map<String, File> files = mr.getMultipartFiles(); |
642 |
System.out.println("4"); |
|
640 |
Iterator keys = files.keySet().iterator(); |
|
641 |
while(keys.hasNext()) |
|
642 |
{ |
|
643 |
String key = (String)keys.next(); |
|
644 |
System.out.println("files key: " + key); |
|
645 |
System.out.println("files value: " + files.get(key)); |
|
646 |
} |
|
647 |
|
|
643 | 648 |
Map<String, List<String>> params = mr.getMultipartParameters(); |
644 |
File f = files.get("sysmeta"); |
|
649 |
keys = params.keySet().iterator(); |
|
650 |
while(keys.hasNext()) |
|
651 |
{ |
|
652 |
String key = (String)keys.next(); |
|
653 |
System.out.println("params key: " + key); |
|
654 |
System.out.println("params value: " + params.get(key)); |
|
655 |
} |
|
656 |
|
|
657 |
//File f = files.get("sysmeta"); |
|
658 |
//the files are not being keyed by the part name, but rather the filename |
|
659 |
File f = files.get(files.keySet().iterator().next()); |
|
660 |
|
|
645 | 661 |
System.out.println("file: " + f.getAbsolutePath()); |
646 | 662 |
String sourceNode = params.get("sourceNode").get(0); |
647 | 663 |
System.out.println("sourceNode: " + sourceNode); |
Also available in: Unified diff
trying to get the new MMP handler working with ResourceHandler