Revision 6124
Added by Chris Jones almost 13 years ago
ResourceHandler.java | ||
---|---|---|
45 | 45 |
import org.apache.log4j.Logger; |
46 | 46 |
import org.apache.maven.artifact.ant.shaded.IOUtil; |
47 | 47 |
import org.dataone.client.MNode; |
48 |
import org.dataone.client.ObjectFormatCache; |
|
48 | 49 |
import org.dataone.mimemultipart.MultipartRequest; |
49 | 50 |
import org.dataone.mimemultipart.MultipartRequestResolver; |
50 | 51 |
import org.dataone.service.NodeListParser; |
... | ... | |
538 | 539 |
if(params.containsKey("format")) |
539 | 540 |
{ |
540 | 541 |
String format = params.get("format")[0]; |
541 |
of = ObjectFormat.convert(format);
|
|
542 |
of = ObjectFormatCache.getFormat(format);
|
|
542 | 543 |
} |
543 | 544 |
if(params.containsKey("time")) |
544 | 545 |
{ |
... | ... | |
575 | 576 |
if(params.containsKey("format")) |
576 | 577 |
{ |
577 | 578 |
String format = params.get("format")[0]; |
578 |
of = ObjectFormat.convert(format);
|
|
579 |
of = ObjectFormatCache.getFormat(format);
|
|
579 | 580 |
} |
580 | 581 |
if(params.containsKey("eventtime")) |
581 | 582 |
{ |
... | ... | |
1164 | 1165 |
SystemMetadata sm = cs.getSystemMetadata(token, id); |
1165 | 1166 |
|
1166 | 1167 |
//set the content type |
1167 |
if(sm.getObjectFormat().toString().trim().equals(ObjectFormat.TEXT_CSV.toString())) |
|
1168 |
if(sm.getObjectFormat().toString().trim().equals( |
|
1169 |
ObjectFormatCache.getFormat("text/csv").getFmtid().getValue())) |
|
1168 | 1170 |
{ |
1169 | 1171 |
response.setContentType("text/csv"); |
1170 | 1172 |
response.setHeader("Content-Disposition", "inline; filename=" + id.getValue() + ".csv"); |
1171 | 1173 |
} |
1172 |
else if(sm.getObjectFormat().toString().trim().equals(ObjectFormat.TEXT_PLAIN.toString())) |
|
1174 |
else if(sm.getObjectFormat().toString().trim().equals( |
|
1175 |
ObjectFormatCache.getFormat("text/plain").getFmtid().getValue())) |
|
1173 | 1176 |
{ |
1174 | 1177 |
response.setContentType("text/plain"); |
1175 | 1178 |
response.setHeader("Content-Disposition", "inline; filename=" + id.getValue() + ".txt"); |
1176 | 1179 |
} |
1177 |
else if(sm.getObjectFormat().toString().trim().equals(ObjectFormat.OCTET_STREAM.toString())) |
|
1180 |
else if(sm.getObjectFormat().toString().trim().equals( |
|
1181 |
ObjectFormatCache.getFormat("application/octet-stream").getFmtid().getValue())) |
|
1178 | 1182 |
{ |
1179 | 1183 |
response.setContentType("application/octet-stream"); |
1180 | 1184 |
} |
... | ... | |
1271 | 1275 |
} |
1272 | 1276 |
else if(name.equals("objectFormat") && value != null) |
1273 | 1277 |
{ |
1274 |
objectFormat = ObjectFormat.convert(value[0]);
|
|
1278 |
objectFormat = ObjectFormatCache.getFormat(value[0]);
|
|
1275 | 1279 |
} |
1276 | 1280 |
else if(name.equals("replicaStatus") && value != null) |
1277 | 1281 |
{ |
Also available in: Unified diff
Merged in the D1_0_6_2_BRANCH changes that include the transition from ObjectFormat calls to ObjectFormatCache calls.