Index: /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/Lakewalker.java
===================================================================
--- /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/Lakewalker.java	(revision 30859)
+++ /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/Lakewalker.java	(revision 30860)
@@ -3,5 +3,4 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
@@ -19,6 +18,4 @@
     private String wmslayer;
 
-    private File workingdir;
-
     private int[] dirslat = new int[] {0,1,1,1,0,-1,-1,-1};
     private int[] dirslon = new int[] {1,1,0,-1,-1,-1,0,1};
@@ -27,5 +24,5 @@
     double start_radius_small = 0.0002;
 
-    public Lakewalker(int waylen, int maxnode, int threshold, double epsilon, int resolution, int tilesize, String startdir, String wmslayer, File workingdir){
+    public Lakewalker(int waylen, int maxnode, int threshold, double epsilon, int resolution, int tilesize, String startdir, String wmslayer){
         this.maxnode = maxnode;
         this.threshold = threshold;
@@ -34,6 +31,4 @@
         this.startdir = startdir;
         this.wmslayer = wmslayer;
-
-        this.workingdir = workingdir;
     }
 
@@ -88,5 +83,5 @@
         try {
 
-            LakewalkerWMS wms = new LakewalkerWMS(this.resolution, this.tilesize, this.wmslayer, this.workingdir);
+            LakewalkerWMS wms = new LakewalkerWMS(this.resolution, this.tilesize, this.wmslayer);
             LakewalkerBBox bbox = new LakewalkerBBox(tl_lat,tl_lon,br_lat,br_lon);
 
Index: /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerAction.java
===================================================================
--- /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerAction.java	(revision 30859)
+++ /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerAction.java	(revision 30860)
@@ -76,6 +76,5 @@
 
         for (String wmsFolder : LakewalkerPreferences.WMSLAYERS) {
-            String wmsCacheDirName = Main.pref.getPreferencesDir()+"plugins/Lakewalker/"+wmsFolder;
-            File wmsCacheDir = new File(wmsCacheDirName);
+            File wmsCacheDir = new File(LakewalkerPlugin.getLakewalkerCacheDir(), wmsFolder);
 
             if (wmsCacheDir.exists() && wmsCacheDir.isDirectory()) {
@@ -107,9 +106,9 @@
                     }
                 }
-
             } else {
                 // create cache directory
                 if (!wmsCacheDir.mkdirs()) {
-                    JOptionPane.showMessageDialog(Main.parent, tr("Error creating cache directory: {0}", wmsCacheDirName));
+                    JOptionPane.showMessageDialog(Main.parent,
+                    		tr("Error creating cache directory: {0}", wmsCacheDir.getPath()));
                 }
             }
@@ -118,16 +117,9 @@
 
     protected void lakewalk(Point clickPoint){
-        /**
-        * Positional data
-        */
+        // Positional data
         final LatLon pos = Main.map.mapView.getLatLon(clickPoint.x, clickPoint.y);
         final LatLon topLeft = Main.map.mapView.getLatLon(0, 0);
         final LatLon botRight = Main.map.mapView.getLatLon(Main.map.mapView.getWidth(),
             Main.map.mapView.getHeight());
-
-        /**
-        * Cache/working directory location
-        */
-        final File working_dir = new File(Main.pref.getPreferencesDir(), "plugins/Lakewalker");
 
         /*
@@ -149,5 +141,5 @@
                     cleanupCache();
                     processnodelist(pos, topLeft, botRight, waylen, maxnode, threshold,
-                            epsilon,resolution,tilesize,startdir,wmslayer, working_dir,
+                            epsilon,resolution,tilesize,startdir,wmslayer,
                             progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false));
                 }
@@ -167,10 +159,11 @@
     }
 
-    private void processnodelist(LatLon pos, LatLon topLeft, LatLon botRight, int waylen, int maxnode, int threshold, double epsilon, int resolution, int tilesize, String startdir, String wmslayer, File workingdir, ProgressMonitor progressMonitor){
+    private void processnodelist(LatLon pos, LatLon topLeft, LatLon botRight, int waylen, int maxnode, int threshold,
+    		double epsilon, int resolution, int tilesize, String startdir, String wmslayer, ProgressMonitor progressMonitor){
         progressMonitor.beginTask(null, 3);
         try {
             ArrayList<double[]> nodelist = new ArrayList<>();
 
-            Lakewalker lw = new Lakewalker(waylen,maxnode,threshold,epsilon,resolution,tilesize,startdir,wmslayer,workingdir);
+            Lakewalker lw = new Lakewalker(waylen,maxnode,threshold,epsilon,resolution,tilesize,startdir,wmslayer);
             try {
                 nodelist = lw.trace(pos.lat(),pos.lon(),topLeft.lon(),botRight.lon(),topLeft.lat(),botRight.lat(),
Index: /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerPlugin.java
===================================================================
--- /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerPlugin.java	(revision 30859)
+++ /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerPlugin.java	(revision 30860)
@@ -2,4 +2,6 @@
 
 import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.io.File;
 
 import org.openstreetmap.josm.Main;
@@ -21,8 +23,10 @@
 
     @Override
-    public PreferenceSetting getPreferenceSetting()
-    {
+    public PreferenceSetting getPreferenceSetting() {
         return new LakewalkerPreferences();
     }
 
+    public static File getLakewalkerCacheDir() {
+    	return new File(Main.pref.getCacheDirectory(), "lakewalkerwms");
+    }
 }
Index: /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerWMS.java
===================================================================
--- /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerWMS.java	(revision 30859)
+++ /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerWMS.java	(revision 30860)
@@ -38,10 +38,7 @@
     private String wmslayer;
 
-    private File working_dir;
-
-    public LakewalkerWMS(int resolution, int tilesize, String wmslayer, File workdir){
+    public LakewalkerWMS(int resolution, int tilesize, String wmslayer){
         this.resolution = resolution;
         this.tilesize = tilesize;
-        this.working_dir = workdir;
         this.wmslayer = wmslayer;
     }
@@ -78,5 +75,5 @@
             "&width="+this.tilesize+"&height="+this.tilesize;
 
-            File file = new File(this.working_dir,filename);
+            File file = new File(LakewalkerPlugin.getLakewalkerCacheDir(), filename);
 
             // Calculate the hashmap key
