private JsonSimple getConfigFromStorage ( String oid ) { String configOid = null ; String configPid = null ; // Get our object and look for its config info try { DigitalObject object = storage . getObject ( oid ) ; Properties metadata = object . getMetadata ( ) ; configOid = metadata . getProperty ( "jsonConfigOid" ) ; configPid = metadata . getProperty ( "jsonConfigPid" ) ; } catch ( StorageException ex ) { log . error ( "Error accessing object '{}' in storage: " , oid , ex ) ; return null ; } // Validate if ( configOid == null || configPid == null ) { log . error ( "Unable to find configuration for OID '{}'" , oid ) ; return null ; } // Grab the config from storage try { DigitalObject object = storage . getObject ( configOid ) ; Payload payload = object . getPayload ( configPid ) ; try { return new JsonSimple ( payload . open ( ) ) ; } catch ( IOException ex ) { log . error ( "Error accessing config '{}' in storage: " , configOid , ex ) ; } finally { payload . close ( ) ; } } catch ( StorageException ex ) { log . error ( "Error accessing object in storage: " , ex ) ; } // Something screwed the pooch return null ; }
Get the stored harvest configuration from storage for the indicated object .