Ignore:
Timestamp:
2009-07-08T15:26:12+02:00 (17 years ago)
Author:
stoecker
Message:

close #2874 (NPE), improved external style handling

File:
1 edited

Legend:

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

    r1743 r1747  
    6262    {
    6363       return file;
     64    }
     65
     66    static public void cleanup(String name)
     67    {
     68      cleanup(name, null);
     69    }
     70    static public void cleanup(String name, String destDir)
     71    {
     72        URL url;
     73        try {
     74            url = new URL(name);
     75            if (!url.getProtocol().equals("file"))
     76            {
     77                String localPath = Main.pref.get("mirror." + url);
     78                if (localPath != null && localPath.length() > 0)
     79                {
     80                    String[] lp = localPath.split(";");
     81                    File lfile = new File(lp[1]);
     82                    if(lfile.exists())
     83                        lfile.delete();
     84                }
     85                Main.pref.put("mirror." + url, null);
     86            }
     87        } catch (java.net.MalformedURLException e) {}
    6488    }
    6589
Note: See TracChangeset for help on using the changeset viewer.