Revision 8899
Added by Jing Tao about 10 years ago
src/edu/ucsb/nceas/metacat/restservice/v1/MNResourceHandler.java | ||
---|---|---|
1071 | 1071 |
if (pid != null) { //get a specific document |
1072 | 1072 |
Identifier id = new Identifier(); |
1073 | 1073 |
id.setValue(pid); |
1074 |
|
|
1074 |
InputStream data = MNodeService.getInstance(request).get(session, id); |
|
1075 | 1075 |
SystemMetadata sm = MNodeService.getInstance(request).getSystemMetadata(session, id); |
1076 | 1076 |
|
1077 | 1077 |
// set the headers for the content |
... | ... | |
1086 | 1086 |
} |
1087 | 1087 |
response.setContentType(mimeType); |
1088 | 1088 |
response.setHeader("Content-Disposition", "inline; filename=" + filename); |
1089 |
|
|
1090 |
InputStream data = MNodeService.getInstance(request).get(session, id); |
|
1091 |
|
|
1092 | 1089 |
out = response.getOutputStream(); |
1093 | 1090 |
IOUtils.copyLarge(data, out); |
1094 | 1091 |
|
Also available in: Unified diff
Move the code to get the object in front of the method to get the system metadata.