- Timestamp:
- 2018-02-10T15:07:48+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r13396 r13402 22 22 import java.net.ProxySelector; 23 23 import java.net.URL; 24 import java.nio.file.Paths; 24 25 import java.security.AllPermission; 25 26 import java.security.CodeSource; … … 169 170 import org.openstreetmap.josm.tools.Territories; 170 171 import org.openstreetmap.josm.tools.Utils; 171 import org.openstreetmap.josm.tools.bugreport.BugReport;172 172 import org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler; 173 173 import org.openstreetmap.josm.tools.bugreport.BugReportQueue; … … 954 954 XMLCommandProcessor config = new XMLCommandProcessor(Main.pref); 955 955 for (String i : args.get(Option.LOAD_PREFERENCES)) { 956 Logging.info("Reading preferences from " + i); 957 try (InputStream is = Utils.openStream(new URL(i))) { 958 config.openAndReadXML(is); 956 try { 957 URL url = i.contains("://") ? new URL(i) : Paths.get(i).toUri().toURL(); 958 Logging.info("Reading preferences from " + url); 959 try (InputStream is = Utils.openStream(url)) { 960 config.openAndReadXML(is); 961 } 959 962 } catch (IOException ex) { 960 throw BugReport.intercept(ex).put("file", i); 963 Logging.error(ex); 964 return; 961 965 } 962 966 }
Note:
See TracChangeset
for help on using the changeset viewer.