Skip to content

Commit

Permalink
get content store from configuration instead of only the primary store
Browse files Browse the repository at this point in the history
  • Loading branch information
nwoodward committed Jul 26, 2024
1 parent f5942ec commit 6764cad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions config/modules/duracloud.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ duracloud.port = 443
# http://demo.duracloud.org/[context]/[space-id]/[filename]
duracloud.context = durastore

# DuraCloud Content Store ID
duracloud.store-id = 0

# DuraCloud user name
duracloud.username = rep-agent
# DuraCloud password
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,14 @@ public void init() throws IOException {
defaultWait = configurationService.getIntProperty("duracloud.retry.wait", DEFAULT_WAIT_BETWEEN_RETRIES);
waitMultiplier = configurationService.getIntProperty("duracloud.retry.multiplier", DEFAULT_WAIT_MULTIPLIER);

// Attempt to get Content Store from a parameter in the configuration
String storeId = configurationService.getProperty("duracloud.store-id", "0");
try {
//Get the primary content store (e.g. Amazon)
dcStore = storeManager.getPrimaryContentStore();
dcStore = storeManager.getContentStore(storeId);
} catch (ContentStoreException csE) {
throw new IOException("Unable to connect to the DuraCloud Primary Content Store. Please check the " +
"DuraCloud connection/authentication settings in your 'duracloud.cfg' file.", csE);
throw new IOException("Unable to connect to the DuraCloud Content Store. " +
"Please check the DuraCloud connection/authentication settings " +
"and the store-id setting in your 'duracloud.cfg' file.", csE);
}
}

Expand Down

0 comments on commit 6764cad

Please sign in to comment.