Revision 5955
Added by berkley almost 14 years ago
src/edu/ucsb/nceas/metacat/restservice/ResourceHandler.java | ||
---|---|---|
1167 | 1167 |
if(sm.getObjectFormat().toString().trim().equals(ObjectFormat.TEXT_CSV.toString())) |
1168 | 1168 |
{ |
1169 | 1169 |
response.setContentType("text/csv"); |
1170 |
response.setHeader("Content-Disposition", "inline; filename=" + id.getValue() + ".csv"); |
|
1170 | 1171 |
} |
1171 | 1172 |
else if(sm.getObjectFormat().toString().trim().equals(ObjectFormat.TEXT_PLAIN.toString())) |
1172 | 1173 |
{ |
1173 | 1174 |
response.setContentType("text/plain"); |
1175 |
response.setHeader("Content-Disposition", "inline; filename=" + id.getValue() + ".txt"); |
|
1174 | 1176 |
} |
1175 | 1177 |
else if(sm.getObjectFormat().toString().trim().equals(ObjectFormat.OCTET_STREAM.toString())) |
1176 | 1178 |
{ |
... | ... | |
1179 | 1181 |
else |
1180 | 1182 |
{ |
1181 | 1183 |
response.setContentType("text/xml"); |
1184 |
response.setHeader("Content-Disposition", "inline; filename=" + id.getValue() + ".xml"); |
|
1182 | 1185 |
} |
1183 | 1186 |
|
1184 | 1187 |
InputStream data = cs.get(token, id); |
Also available in: Unified diff
added file extension for txt or csv files