Ignore:
Timestamp:
2018-04-19T20:37:16+02:00 (19 months ago)
Author:
Don-vip
Message:

see #16204 - Allow to start and close JOSM in WebStart sandbox mode (where every external access is denied). This was very useful to reproduce some very tricky bugs that occured in real life but were almost impossible to diagnose.

Location:
trunk/src/org/openstreetmap/josm/io
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/CacheCustomContent.java

    r13204 r13647  
    205205            output.write(this.data);
    206206            output.flush();
    207         } catch (IOException | InvalidPathException e) {
    208             Logging.error(e);
     207        } catch (IOException | InvalidPathException | SecurityException e) {
     208            Logging.log(Logging.LEVEL_ERROR, "Unable to save data", e);
    209209        }
    210210    }
  • trunk/src/org/openstreetmap/josm/io/CachedFile.java

    r13560 r13647  
    282282                }
    283283            } else {
    284                 cacheFile = checkLocal(url);
     284                try {
     285                    cacheFile = checkLocal(url);
     286                } catch (SecurityException e) {
     287                    throw new IOException(e);
     288                }
    285289            }
    286290        } catch (MalformedURLException e) {
  • trunk/src/org/openstreetmap/josm/io/CertificateAmendment.java

    r13605 r13647  
    192192            return;
    193193        KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
    194         Path cacertsPath = Paths.get(System.getProperty("java.home"), "lib", "security", "cacerts");
     194        Path cacertsPath = Paths.get(Utils.getSystemProperty("java.home"), "lib", "security", "cacerts");
    195195        try (InputStream is = Files.newInputStream(cacertsPath)) {
    196196            keyStore.load(is, "changeit".toCharArray());
     197        } catch (SecurityException e) {
     198            Logging.log(Logging.LEVEL_ERROR, "Unable to load keystore", e);
     199            return;
    197200        }
    198201
  • trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java

    r13493 r13647  
    2020import org.openstreetmap.josm.spi.preferences.Config;
    2121import org.openstreetmap.josm.tools.Logging;
     22import org.openstreetmap.josm.tools.Utils;
    2223
    2324/**
     
    5960    private static boolean jvmWillUseSystemProxies;
    6061    static {
    61         String v = System.getProperty("java.net.useSystemProxies");
     62        String v = Utils.getSystemProperty("java.net.useSystemProxies");
    6263        if (v != null && v.equals(Boolean.TRUE.toString())) {
    6364            jvmWillUseSystemProxies = true;
  • trunk/src/org/openstreetmap/josm/io/OsmApi.java

    r13499 r13647  
    252252                // In that case, force update and try again
    253253                initializeCapabilities(cache.updateForceString());
     254            } catch (SecurityException e) {
     255                Logging.log(Logging.LEVEL_ERROR, "Unable to initialize OSM API", e);
    254256            }
    255257            if (capabilities == null) {
  • trunk/src/org/openstreetmap/josm/io/protocols/data/Handler.java

    r10936 r13647  
    3030        String pkg = pkgName.substring(0, pkgName.lastIndexOf('.'));
    3131
    32         String protocolHandlers = System.getProperty("java.protocol.handler.pkgs", "");
    33         if (!protocolHandlers.contains(pkg)) {
     32        String protocolHandlers = Utils.getSystemProperty("java.protocol.handler.pkgs");
     33        if (protocolHandlers != null && !protocolHandlers.contains(pkg)) {
    3434            StringBuilder sb = new StringBuilder(protocolHandlers);
    3535            if (sb.length() > 0) {
Note: See TracChangeset for help on using the changeset viewer.