mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 23:13:10 +00:00
DS-3059 Replacing getProperty with getArrayProperty
This commit is contained in:
@@ -79,10 +79,10 @@ public class MediaFilterServiceImpl implements MediaFilterService, InitializingB
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
String publicPermissionFilters = configurationService.getProperty("filter.org.dspace.app.mediafilter.publicPermission");
|
||||
String[] publicPermissionFilters = configurationService.getArrayProperty("filter.org.dspace.app.mediafilter.publicPermission");
|
||||
|
||||
if(publicPermissionFilters != null) {
|
||||
String[] publicPermisionFiltersArray = publicPermissionFilters.split(",");
|
||||
for(String filter : publicPermisionFiltersArray) {
|
||||
for(String filter : publicPermissionFilters) {
|
||||
publicFiltersClasses.add(filter.trim());
|
||||
}
|
||||
}
|
||||
|
@@ -77,9 +77,10 @@ public class DayTableEmbargoSetter extends DefaultEmbargoSetter
|
||||
{
|
||||
Properties termProps = new Properties();
|
||||
|
||||
String terms = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("embargo.terms.days");
|
||||
if (terms != null && terms.length() > 0) {
|
||||
for (String term : terms.split(",")) {
|
||||
String terms[] = DSpaceServicesFactory.getInstance().getConfigurationService().getArrayProperty("embargo.terms.days");
|
||||
|
||||
if (terms != null) {
|
||||
for (String term : terms) {
|
||||
String[] parts = term.trim().split(":");
|
||||
termProps.setProperty(parts[0].trim(), parts[1].trim());
|
||||
}
|
||||
|
@@ -115,15 +115,14 @@ public class RDFConfiguration {
|
||||
|
||||
public static String[] getDSOTypesToConvert()
|
||||
{
|
||||
String dsoTypes = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty(
|
||||
CONVERTER_DSOTYPES_KEY);
|
||||
if (StringUtils.isEmpty(dsoTypes))
|
||||
String[] dsoTypes = DSpaceServicesFactory.getInstance().getConfigurationService().getArrayProperty(CONVERTER_DSOTYPES_KEY);
|
||||
if (dsoTypes == null)
|
||||
{
|
||||
log.warn("Property rdf." + CONVERTER_DSOTYPES_KEY + " was not found "
|
||||
+ "or is empty. Will convert all type of DSpace Objects.");
|
||||
return Constants.typeText;
|
||||
}
|
||||
return dsoTypes.split(",\\s*");
|
||||
return dsoTypes;
|
||||
}
|
||||
|
||||
public static boolean isConvertType(int type)
|
||||
|
@@ -108,12 +108,11 @@ public class EmailServiceImpl
|
||||
}
|
||||
|
||||
// Set extra configuration properties
|
||||
String extras = cfg.getProperty("mail.extraproperties");
|
||||
if ((extras != null) && (!"".equals(extras.trim())))
|
||||
String[] extras = cfg.getArrayProperty("mail.extraproperties");
|
||||
if (extras != null)
|
||||
{
|
||||
String arguments[] = extras.split(",");
|
||||
String key, value;
|
||||
for (String argument : arguments)
|
||||
for (String argument : extras)
|
||||
{
|
||||
key = argument.substring(0, argument.indexOf('=')).trim();
|
||||
value = argument.substring(argument.indexOf('=') + 1).trim();
|
||||
|
@@ -152,8 +152,8 @@ public class FlowCurationUtils
|
||||
*/
|
||||
protected static String getUITaskName(String taskID)
|
||||
{
|
||||
String tasksString = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("curate.ui.tasknames");
|
||||
String[] tasks = tasksString.split(",");
|
||||
String[] tasks = DSpaceServicesFactory.getInstance().getConfigurationService().getArrayProperty("curate.ui.tasknames");
|
||||
|
||||
for (String task : tasks)
|
||||
{
|
||||
//retrieve keyValuePair (format [taskID]=[UI Task Name])
|
||||
|
@@ -153,10 +153,10 @@ public class CollectionViewer extends AbstractDSpaceTransformer implements Cache
|
||||
HandleUtil.buildHandleTrail(context, collection,pageMeta,contextPath);
|
||||
|
||||
// Add RSS links if available
|
||||
String formats = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("webui.feed.formats");
|
||||
String[] formats = DSpaceServicesFactory.getInstance().getConfigurationService().getArrayProperty("webui.feed.formats");
|
||||
if ( formats != null )
|
||||
{
|
||||
for (String format : formats.split(","))
|
||||
for (String format : formats)
|
||||
{
|
||||
// Remove the protocol number, i.e. just list 'rss' or' atom'
|
||||
String[] parts = format.split("_");
|
||||
|
@@ -198,10 +198,10 @@ public class CommunityViewer extends AbstractDSpaceTransformer implements Cachea
|
||||
HandleUtil.buildHandleTrail(context, community, pageMeta,contextPath);
|
||||
|
||||
// Add RSS links if available
|
||||
String formats = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("webui.feed.formats");
|
||||
String[] formats = DSpaceServicesFactory.getInstance().getConfigurationService().getArrayProperty("webui.feed.formats");
|
||||
if ( formats != null )
|
||||
{
|
||||
for (String format : formats.split(","))
|
||||
for (String format : formats)
|
||||
{
|
||||
// Remove the protocol number, i.e. just list 'rss' or' atom'
|
||||
String[] parts = format.split("_");
|
||||
|
@@ -65,10 +65,10 @@ public class FrontPageFeeds extends AbstractDSpaceTransformer implements Cacheab
|
||||
pageMeta.addTrailLink(contextPath, T_dspace_home);
|
||||
|
||||
// Add RSS links if available
|
||||
String formats = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("webui.feed.formats");
|
||||
String[] formats = DSpaceServicesFactory.getInstance().getConfigurationService().getArrayProperty("webui.feed.formats");
|
||||
if ( formats != null )
|
||||
{
|
||||
for (String format : formats.split(","))
|
||||
for (String format : formats)
|
||||
{
|
||||
// Remove the protocol number, i.e. just list 'rss' or' atom'
|
||||
String[] parts = format.split("_");
|
||||
|
@@ -52,17 +52,15 @@ public class SendFeedbackAction extends AbstractAction
|
||||
String fromPage = request.getHeader("Referer");
|
||||
// Prevent spammers and splogbots from poisoning the feedback page
|
||||
String host = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("dspace.hostname");
|
||||
String allowedReferrersString = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("mail.allowed.referrers");
|
||||
String[] allowedReferrers = DSpaceServicesFactory.getInstance().getConfigurationService().getArrayProperty("mail.allowed.referrers");
|
||||
|
||||
String[] allowedReferrersSplit = null;
|
||||
boolean validReferral = false;
|
||||
|
||||
if((allowedReferrersString != null) && (allowedReferrersString.length() > 0))
|
||||
if(allowedReferrers != null)
|
||||
{
|
||||
allowedReferrersSplit = allowedReferrersString.trim().split("\\s*,\\s*");
|
||||
for(int i = 0; i < allowedReferrersSplit.length; i++)
|
||||
for(String allowedReferrer : allowedReferrers)
|
||||
{
|
||||
if(fromPage.indexOf(allowedReferrersSplit[i]) != -1)
|
||||
if(fromPage.contains(allowedReferrer))
|
||||
{
|
||||
validReferral = true;
|
||||
break;
|
||||
|
@@ -170,10 +170,10 @@ public class CollectionSearch extends AbstractDSpaceTransformer implements Cache
|
||||
HandleUtil.buildHandleTrail(context, collection,pageMeta,contextPath);
|
||||
|
||||
// Add RSS links if available
|
||||
String formats = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("webui.feed.formats");
|
||||
String[] formats = DSpaceServicesFactory.getInstance().getConfigurationService().getArrayProperty("webui.feed.formats");
|
||||
if ( formats != null )
|
||||
{
|
||||
for (String format : formats.split(","))
|
||||
for (String format : formats)
|
||||
{
|
||||
// Remove the protocol number, i.e. just list 'rss' or' atom'
|
||||
String[] parts = format.split("_");
|
||||
|
@@ -65,10 +65,10 @@ public class SiteViewer extends AbstractDSpaceTransformer implements CacheablePr
|
||||
pageMeta.addTrailLink(contextPath, T_dspace_home);
|
||||
|
||||
// Add RSS links if available
|
||||
String formats = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("webui.feed.formats");
|
||||
String[] formats = DSpaceServicesFactory.getInstance().getConfigurationService().getArrayProperty("webui.feed.formats");
|
||||
if ( formats != null )
|
||||
{
|
||||
for (String format : formats.split(","))
|
||||
for (String format : formats)
|
||||
{
|
||||
// Remove the protocol number, i.e. just list 'rss' or' atom'
|
||||
String[] parts = format.split("_");
|
||||
|
@@ -94,10 +94,10 @@ public class RecentSubmissionTransformer extends AbstractDSpaceTransformer {
|
||||
if(isHomePage)
|
||||
{
|
||||
// Add RSS links if available
|
||||
String formats = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("webui.feed.formats");
|
||||
String[] formats = DSpaceServicesFactory.getInstance().getConfigurationService().getArrayProperty("webui.feed.formats");
|
||||
if ( formats != null )
|
||||
{
|
||||
for (String format : formats.split(","))
|
||||
for (String format : formats)
|
||||
{
|
||||
// Remove the protocol number, i.e. just list 'rss' or' atom'
|
||||
String[] parts = format.split("_");
|
||||
|
@@ -107,11 +107,10 @@ public class HandleResolverReader extends AbstractReader implements Recyclable {
|
||||
{
|
||||
List<String> prefixes = new ArrayList<String>();
|
||||
prefixes.add(handleService.getPrefix());
|
||||
String additionalPrefixes = DSpaceServicesFactory.getInstance().getConfigurationService()
|
||||
.getProperty("handle.additional.prefixes");
|
||||
if (StringUtils.isNotBlank(additionalPrefixes))
|
||||
String[] additionalPrefixes = DSpaceServicesFactory.getInstance().getConfigurationService().getArrayProperty("handle.additional.prefixes");
|
||||
if (additionalPrefixes != null)
|
||||
{
|
||||
for (String apref : additionalPrefixes.split(","))
|
||||
for (String apref : additionalPrefixes)
|
||||
{
|
||||
prefixes.add(apref.trim());
|
||||
}
|
||||
|
@@ -163,7 +163,7 @@ public class JSONLookupSearcher extends AbstractGenerator {
|
||||
|
||||
public String getLookupURI() {
|
||||
if(lookupURI ==null){
|
||||
lookupURI = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("publication-lookup.ublication.url");
|
||||
lookupURI = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("publication-lookup.publication.url");
|
||||
}
|
||||
return lookupURI;
|
||||
}
|
||||
|
Reference in New Issue
Block a user