import java.io.FileOutputStream;\r
import java.io.IOException;\r
import java.io.InputStream;\r
+import java.net.MalformedURLException;\r
import java.net.URL;\r
import java.net.URLConnection;\r
import java.net.URLStreamHandler;\r
throws Exception {\r
URL xmlConfiguration = null;\r
\r
- if (System.getProperty(CatalinaActivator.ARGEO_SERVER_TOMCAT_CONFIG) != null)\r
- xmlConfiguration = new URL(\r
- System.getProperty(CatalinaActivator.ARGEO_SERVER_TOMCAT_CONFIG));\r
- else\r
+ if (System.getProperty(CatalinaActivator.ARGEO_SERVER_TOMCAT_CONFIG) != null) {\r
+ String customConfig = System\r
+ .getProperty(CatalinaActivator.ARGEO_SERVER_TOMCAT_CONFIG);\r
+ try {\r
+ xmlConfiguration = new URL(customConfig);\r
+ } catch (MalformedURLException e) {\r
+ // within this bundle\r
+ // typically 'default-server-ssl.xml'\r
+ xmlConfiguration = bundle.getResource(customConfig);\r
+ }\r
+ } else {\r
// fragment\r
xmlConfiguration = bundle.getResource(XML_CONF_LOCATION);\r
+ }\r
\r
if (xmlConfiguration != null) {\r
log.info("Using custom XML configuration " + xmlConfiguration);\r