Merge pull request #428 from KevinVdV/DS-1832

[DS-1832] Proxy configuration set in system properties if empty
This commit is contained in:
Bram Luyten
2013-12-21 03:11:25 -08:00
2 changed files with 5 additions and 3 deletions

View File

@@ -25,6 +25,7 @@ import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.apache.commons.cli.PosixParser;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.dspace.content.Collection;
import org.dspace.content.Community;
@@ -316,8 +317,8 @@ public class GenerateSitemaps
throws MalformedURLException, UnsupportedEncodingException
{
// Set up HTTP proxy
if ((ConfigurationManager.getProperty("http.proxy.host") != null)
&& (ConfigurationManager.getProperty("http.proxy.port") != null))
if ((StringUtils.isNotBlank(ConfigurationManager.getProperty("http.proxy.host")))
&& (StringUtils.isNotBlank(ConfigurationManager.getProperty("http.proxy.port"))))
{
System.setProperty("proxySet", "true");
System.setProperty("proxyHost", ConfigurationManager

View File

@@ -20,6 +20,7 @@ import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.dspace.authorize.AuthorizeException;
import org.dspace.content.Bitstream;
@@ -61,7 +62,7 @@ public class CreativeCommons
String proxyHost = ConfigurationManager.getProperty("http.proxy.host");
String proxyPort = ConfigurationManager.getProperty("http.proxy.port");
if ((proxyHost != null) && (proxyPort != null))
if (StringUtils.isNotBlank(proxyHost) && StringUtils.isNotBlank(proxyPort))
{
System.setProperty("http.proxyHost", proxyHost);
System.setProperty("http.proxyPort", proxyPort);