Revision 7023
Added by ben leinfelder over 12 years ago
src/edu/ucsb/nceas/metacat/IdentifierManager.java | ||
---|---|---|
315 | 315 |
Subject submitterSubject = new Subject(); |
316 | 316 |
submitterSubject.setValue(submitter); |
317 | 317 |
sysMeta.setSubmitter(submitterSubject); |
318 |
ObjectFormatIdentifier fmtid = null; |
|
319 |
try { |
|
320 |
ObjectFormatIdentifier formatId = new ObjectFormatIdentifier(); |
|
321 |
formatId.setValue(fmtidStr); |
|
322 |
fmtid = ObjectFormatCache.getInstance().getFormat(formatId).getFormatId(); |
|
323 |
sysMeta.setFormatId(fmtid); |
|
324 |
|
|
325 |
} catch (BaseException nfe) { |
|
326 |
logMetacat.error("The objectFormat " + fmtidStr + |
|
327 |
" is not registered. Setting the default format id."); |
|
328 |
fmtid = new ObjectFormatIdentifier(); |
|
329 |
fmtid.setValue("application/octet-stream"); |
|
330 |
sysMeta.setFormatId(fmtid); |
|
331 |
|
|
332 |
} |
|
318 |
ObjectFormatIdentifier fmtid = new ObjectFormatIdentifier(); |
|
319 |
fmtid.setValue(fmtidStr); |
|
320 |
sysMeta.setFormatId(fmtid); |
|
333 | 321 |
sysMeta.setSize(size); |
334 | 322 |
if (obsoletes != null) { |
335 | 323 |
Identifier obsoletesId = new Identifier(); |
Also available in: Unified diff
do not "lookup" object format when retrieving system metadata -- just return what we have stored as the formatId and don't [erroneously] default it to binary when there's a problem with the lookup (cache or service or otherwise).
https://redmine.dataone.org/issues/2365