Revision 7757
Added by ben leinfelder almost 11 years ago
MNResourceHandler.java | ||
---|---|---|
84 | 84 |
import org.jibx.runtime.JiBXException; |
85 | 85 |
import org.xml.sax.SAXException; |
86 | 86 |
|
87 |
import edu.ucsb.nceas.metacat.common.query.stream.ContentTypeInputStream; |
|
87 | 88 |
import edu.ucsb.nceas.metacat.dataone.MNodeService; |
88 | 89 |
import edu.ucsb.nceas.metacat.properties.PropertyService; |
89 | 90 |
import edu.ucsb.nceas.utilities.PropertyNotFoundException; |
... | ... | |
422 | 423 |
mnode.setSession(session); |
423 | 424 |
InputStream stream = mnode.query(engine, query); |
424 | 425 |
|
425 |
//response.setContentType("application/octet-stream"); |
|
426 |
//response.setContentType("text/xml"); |
|
426 |
// set the content-type if we have it from the implementation |
|
427 |
if (stream instanceof ContentTypeInputStream) { |
|
428 |
//response.setContentType("application/octet-stream"); |
|
429 |
//response.setContentType("text/xml"); |
|
430 |
response.setContentType(((ContentTypeInputStream) stream).getContentType()); |
|
431 |
} |
|
427 | 432 |
response.setStatus(200); |
428 | 433 |
out = response.getOutputStream(); |
429 | 434 |
// write the results to the output stream |
Also available in: Unified diff
use ContentTypeInputStream interface (and ByteArray implementation) to specify the desired content-type of the InputStream returned by MN.query().