Revision 6139
Added by Chris Jones almost 13 years ago
MetacatHandler.java | ||
---|---|---|
3581 | 3581 |
|
3582 | 3582 |
// set the object format, fall back to defaults |
3583 | 3583 |
try { |
3584 |
format = ObjectFormatCache.getFormat(doctype); |
|
3584 |
format = ObjectFormatCache.getInstance().getFormat(doctype);
|
|
3585 | 3585 |
|
3586 | 3586 |
} catch (NotFound nfe) { |
3587 | 3587 |
|
3588 | 3588 |
try { |
3589 | 3589 |
// format is not registered, use default |
3590 | 3590 |
if (doctype.trim().equals("BIN")) { |
3591 |
format = ObjectFormatCache.getFormat("application/octet-stream"); |
|
3591 |
format = ObjectFormatCache.getInstance().getFormat("application/octet-stream");
|
|
3592 | 3592 |
|
3593 | 3593 |
} else { |
3594 |
format = ObjectFormatCache.getFormat("text/plain"); |
|
3594 |
format = ObjectFormatCache.getInstance().getFormat("text/plain");
|
|
3595 | 3595 |
} |
3596 | 3596 |
|
3597 | 3597 |
} catch (NotFound nf) { |
... | ... | |
3607 | 3607 |
|
3608 | 3608 |
// further parse EML documents to get data object format, |
3609 | 3609 |
// describes and describedBy information |
3610 |
if ( format == ObjectFormatCache.getFormat("eml://ecoinformatics.org/eml-2.0.0") || |
|
3611 |
format == ObjectFormatCache.getFormat("eml://ecoinformatics.org/eml-2.0.1") || |
|
3612 |
format == ObjectFormatCache.getFormat("eml://ecoinformatics.org/eml-2.1.0") || |
|
3613 |
format == ObjectFormatCache.getFormat("eml://ecoinformatics.org/eml-2.1.1") ) { |
|
3610 |
if ( format == ObjectFormatCache.getInstance().getFormat("eml://ecoinformatics.org/eml-2.0.0") ||
|
|
3611 |
format == ObjectFormatCache.getInstance().getFormat("eml://ecoinformatics.org/eml-2.0.1") ||
|
|
3612 |
format == ObjectFormatCache.getInstance().getFormat("eml://ecoinformatics.org/eml-2.1.0") ||
|
|
3613 |
format == ObjectFormatCache.getInstance().getFormat("eml://ecoinformatics.org/eml-2.1.1") ) {
|
|
3614 | 3614 |
|
3615 | 3615 |
try { |
3616 | 3616 |
|
... | ... | |
3631 | 3631 |
// default to binary |
3632 | 3632 |
if (dataDocMimeType == null) { |
3633 | 3633 |
dataDocMimeType = |
3634 |
ObjectFormatCache.getFormat("application/octet-stream").getFmtid().getValue(); |
|
3634 |
ObjectFormatCache.getInstance().getFormat("application/octet-stream").getFmtid().getValue();
|
|
3635 | 3635 |
} |
3636 | 3636 |
String dataDocLocalId = ""; |
3637 | 3637 |
logMetacat.debug("Data local ID: " + dataDocLocalId); |
... | ... | |
3677 | 3677 |
|
3678 | 3678 |
// set object format |
3679 | 3679 |
logMetacat.debug("Updating system metadata for " + dataGuid.getValue() + " to " + dataDocMimeType); |
3680 |
ObjectFormat f = ObjectFormatCache.getFormat(dataDocMimeType); |
|
3680 |
ObjectFormat f = ObjectFormatCache.getInstance().getFormat(dataDocMimeType);
|
|
3681 | 3681 |
if (f == null) { |
3682 |
f = ObjectFormatCache.getFormat("application/octet-stream"); |
|
3682 |
f = ObjectFormatCache.getInstance().getFormat("application/octet-stream");
|
|
3683 | 3683 |
} |
3684 | 3684 |
dataSysMeta.setObjectFormat(f); |
3685 | 3685 |
|
Also available in: Unified diff
Updated CNCoreImpl to implement listFormats() and getFormat(), and changed calls to ObjectFormatCache in IdentifierManager, MetacatHandler to call getInstance(). Removed the ObjectFormatService registration from MetaCatServlet since it is replaced by CNCoreImpl.