Revision 6144
Added by Chris Jones over 13 years ago
src/edu/ucsb/nceas/metacat/util/MetacatPopulator.java | ||
---|---|---|
162 | 162 |
dataPackage.getEntityList()[j].getDataFormat(); |
163 | 163 |
if (dataDocMimeType == null) { |
164 | 164 |
dataDocMimeType = |
165 |
ObjectFormatCache.getFormat("application/octet-stream").getFmtid().getValue(); |
|
165 |
ObjectFormatCache.getInstance().getFormat("application/octet-stream").getFmtid().getValue();
|
|
166 | 166 |
} |
167 | 167 |
String dataDocLocalId = ""; |
168 | 168 |
if(dataDocUrl.trim().startsWith("ecogrid://knb/")) |
... | ... | |
187 | 187 |
SystemMetadata dataDocSysMeta = generateSystemMetadata(doc); |
188 | 188 |
//overwrite the bogus values from the last call |
189 | 189 |
dataDocSysMeta.setIdentifier(did); |
190 |
dataDocSysMeta.setObjectFormat(ObjectFormatCache.getFormat(dataDocMimeType)); |
|
190 |
dataDocSysMeta.setObjectFormat(ObjectFormatCache.getInstance().getFormat(dataDocMimeType));
|
|
191 | 191 |
Checksum checksum = new Checksum(); |
192 | 192 |
dataDocIs = stringToStream(dataDocText); |
193 | 193 |
ChecksumAlgorithm ca = ChecksumAlgorithm.convert("MD5"); |
... | ... | |
270 | 270 |
sm.setIdentifier(id); |
271 | 271 |
|
272 | 272 |
//set the object format |
273 |
ObjectFormat format = ObjectFormatCache.getFormat(doc.doctype); |
|
273 |
ObjectFormat format = ObjectFormatCache.getInstance().getFormat(doc.doctype);
|
|
274 | 274 |
if(format == null) |
275 | 275 |
{ |
276 | 276 |
if(doc.doctype.trim().equals("BIN")) |
277 | 277 |
{ |
278 |
format = ObjectFormatCache.getFormat("application/octet-stream"); |
|
278 |
format = ObjectFormatCache.getInstance().getFormat("application/octet-stream");
|
|
279 | 279 |
} |
280 | 280 |
else |
281 | 281 |
{ |
282 |
format = ObjectFormatCache.getFormat("text/plain"); |
|
282 |
format = ObjectFormatCache.getInstance().getFormat("text/plain");
|
|
283 | 283 |
} |
284 | 284 |
} |
285 | 285 |
sm.setObjectFormat(format); |
Also available in: Unified diff
Updated MetacatPopulator to now use ObjectFormatCache.getInstance(). Note: problems remain with the authentication API changes - calls to mn.login(), etc. need to be addressed.