Revision 6561
Added by ben leinfelder over 12 years ago
CNResourceHandler.java | ||
---|---|---|
424 | 424 |
SystemMetadata sm = CNodeService.getInstance(request).getSystemMetadata(session, id); |
425 | 425 |
|
426 | 426 |
//set the content type |
427 |
if(sm.getFmtid().getValue().trim().equals(
|
|
428 |
ObjectFormatCache.getInstance().getFormat("text/csv").getFmtid().getValue()))
|
|
427 |
if(sm.getFormatId().getValue().trim().equals(
|
|
428 |
ObjectFormatCache.getInstance().getFormat("text/csv").getFormatId().getValue()))
|
|
429 | 429 |
{ |
430 | 430 |
response.setContentType("text/csv"); |
431 | 431 |
response.setHeader("Content-Disposition", "inline; filename=" + id.getValue() + ".csv"); |
432 | 432 |
} |
433 |
else if(sm.getFmtid().getValue().trim().equals(
|
|
434 |
ObjectFormatCache.getInstance().getFormat("text/plain").getFmtid().getValue()))
|
|
433 |
else if(sm.getFormatId().getValue().trim().equals(
|
|
434 |
ObjectFormatCache.getInstance().getFormat("text/plain").getFormatId().getValue()))
|
|
435 | 435 |
{ |
436 | 436 |
response.setContentType("text/plain"); |
437 | 437 |
response.setHeader("Content-Disposition", "inline; filename=" + id.getValue() + ".txt"); |
438 | 438 |
} |
439 |
else if(sm.getFmtid().getValue().trim().equals(
|
|
440 |
ObjectFormatCache.getInstance().getFormat("application/octet-stream").getFmtid().getValue()))
|
|
439 |
else if(sm.getFormatId().getValue().trim().equals(
|
|
440 |
ObjectFormatCache.getInstance().getFormat("application/octet-stream").getFormatId().getValue()))
|
|
441 | 441 |
{ |
442 | 442 |
response.setContentType("application/octet-stream"); |
443 | 443 |
} |
Also available in: Unified diff
move the DataONE 1.0.0-SNAPSHOT