Changeset 8596 in josm for trunk/src/org


Ignore:
Timestamp:
2015-07-11T12:11:08+02:00 (5 years ago)
Author:
wiktorn
Message:

Fix off by one error which breakes openeing local files on linux. Addresses: #10623

File:
1 edited

Legend:

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

    r8570 r8596  
    215215            url = new URL(name);
    216216            if ("file".equals(url.getProtocol())) {
    217                 cacheFile = new File(name.substring("file:/".length()));
     217                System.out.println("file protocol");
     218                cacheFile = new File(name.substring("file:/".length() - 1));
    218219                if (!cacheFile.exists()) {
    219                     cacheFile = new File(name.substring("file://".length()));
    220                 }
    221             } else {
     220                    cacheFile = new File(name.substring("file://".length() - 1));
     221                    System.out.println(cacheFile.getPath());
     222                }
     223            } else {
     224                System.out.println(url.getProtocol() + " doesnt equal file");
    222225                cacheFile = checkLocal(url);
    223226            }
     227            System.out.println(cacheFile.getPath());
    224228        } catch (MalformedURLException e) {
    225229            if (name.startsWith("resource://")) {
Note: See TracChangeset for help on using the changeset viewer.