String key = doc.get("key");
String ftype = doc.get("type");
DatabaseEntry data = new DatabaseEntry();
String dbname = (ftype.equalsIgnoreCase("email")) ? Constants.EXT_MESSAGES_DB: Constants.EXT_FILES_DB;
dbt.openDB(dbname, true, false); //*-- no create and no dups
dbt.fetch(key, data);
dbt.closeDB();
//*-- use the type of the document to create a doc instance of the specified type
String docClass = dprops.getProperty(ftype);