* AbstractFilemgrMetExtractor#doExtract(org.apache.oodt.cas.filemgr.structs.Product,
* org.apache.oodt.cas.metadata.Metadata)
*/
public Metadata doExtract(Product product, Metadata met)
throws MetExtractionException {
Metadata extractMet = new Metadata();
/* copy through original metadata */
merge(met, extractMet);
File prodFile = getProductFile(product);
extractMet
.addMetadata(isNsReplace(PRODUCT_ID) ? elementNs + nsSeparator
+ PRODUCT_ID : PRODUCT_ID, product.getProductId());
addMetadataIfUndefined(met, extractMet,
isNsReplace(FILENAME) ? elementNs + nsSeparator + FILENAME
: FILENAME, prodFile.getName());
addMetadataIfUndefined(met, extractMet,
isNsReplace(FILE_LOCATION) ? elementNs + nsSeparator
+ FILE_LOCATION : FILE_LOCATION, prodFile
.getParentFile().getAbsolutePath());
addMetadataIfUndefined(met, extractMet,
isNsReplace(PRODUCT_NAME) ? elementNs + nsSeparator
+ PRODUCT_NAME : PRODUCT_NAME, product.getProductName());
addMetadataIfUndefined(met, extractMet,
isNsReplace(PRODUCT_STRUCTURE) ? elementNs + nsSeparator
+ PRODUCT_STRUCTURE : PRODUCT_STRUCTURE, product
.getProductStructure());
extractMet.addMetadata(isNsReplace(PRODUCT_RECEVIED_TIME) ? elementNs
+ nsSeparator + PRODUCT_RECEVIED_TIME : PRODUCT_RECEVIED_TIME,
DateConvert.isoFormat(new Date()));
addMetadataIfUndefined(met, extractMet,
isNsReplace(PRODUCT_TYPE) ? elementNs + nsSeparator
+ PRODUCT_TYPE : PRODUCT_TYPE, product.getProductType()