@@ -165,10 +165,10 @@ static boolean checkUrl(final URL file) {
165165 *
166166 * @throws ConfigurationException if it encounters a fatal error.
167167 */
168- public void load () throws ConfigurationException {
168+ public void load (File ... propFile ) throws ConfigurationException {
169169 LOG .debug ("Start DeploymentConfiguration.load()" );
170170 try {
171- load (true );
171+ load (true , propFile );
172172 } catch (final MalformedURLException ex ) {
173173 throw new ConfigurationException (ex .toString ());
174174 } finally {
@@ -184,10 +184,14 @@ public void load() throws ConfigurationException {
184184 * resorting to the default values
185185 * @throws ConfigurationException if it encounters a fatal error.
186186 */
187- public void load (final boolean fixIssues ) throws ConfigurationException , MalformedURLException {
187+ public void load (final boolean fixIssues , File ... propFile ) throws ConfigurationException , MalformedURLException {
188188 final SecurityManager sm = System .getSecurityManager ();
189189 if (sm != null ) {
190- sm .checkRead (userDeploymentFileDescriptor .getFullPath ());
190+ if (propFile .length > 0 ) {
191+ sm .checkRead (clean (propFile [0 ].getAbsolutePath ()));
192+ } else {
193+ sm .checkRead (userDeploymentFileDescriptor .getFullPath ());
194+ }
191195 }
192196
193197 final Map <String , Setting > properties = Defaults .getDefaults ();
@@ -202,9 +206,9 @@ public void load(final boolean fixIssues) throws ConfigurationException, Malform
202206 }
203207
204208 /*
205- * Third, read the user's subdirResult deployment.properties file
209+ * Third, read the user's subdirResult deployment.properties file or the custom config properties
206210 */
207- userPropertiesFile = userDeploymentFileDescriptor .getFile ();
211+ userPropertiesFile = propFile . length > 0 ? propFile [ 0 ] : userDeploymentFileDescriptor .getFile ();
208212 final URL userPropertiesUrl = userPropertiesFile .toURI ().toURL ();
209213 final Map <String , Setting > userProperties = loadProperties (ConfigType .USER , userPropertiesUrl , false );
210214 userComments = loadComments (userPropertiesUrl );
@@ -697,4 +701,11 @@ public static String VVPossibleBrowserValues() {
697701 ConfigurationConstants .KEY_BROWSER_PATH
698702 );
699703 }
704+
705+ private static String clean (String s ) {
706+ while (s .contains (File .separator + File .separator )) {
707+ s = s .replace (File .separator + File .separator , File .separator );
708+ }
709+ return s ;
710+ }
700711}
0 commit comments