Support additional prefixes

This commit is contained in:
Terry Brady
2016-08-15 15:31:02 -07:00
parent 90655910d2
commit f5c4fbce69

View File

@@ -67,14 +67,14 @@ public class HandleIdentifierProvider extends IdentifierProvider {
{ {
return true; return true;
} }
// return true if base prefix matches in case of multi-instance deployment with derived prefixes demarcated by a dot "."
if(prefix.contains(".")) { //Check additional prefixes supported in the config file
String[] splitPrefix = prefix.split("\\."); String[] additionalPrefixes = DSpaceServicesFactory.getInstance().getConfigurationService().getArrayProperty("handle.additional.prefixes");
if(splitPrefix.length > 1 && identifier.startsWith(splitPrefix[0])) { for(String additionalPrefix: additionalPrefixes) {
if (identifier.startsWith(additionalPrefix)) {
return true; return true;
} }
} }
// otherwise, assume invalid handle
return false; return false;
} }