Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheControl.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheControl.java	(revision 17718)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheControl.java	(revision 17719)
@@ -167,5 +167,8 @@
                         ObjectOutputStream oos = new ObjectOutputStream(
                                 new BufferedOutputStream(new FileOutputStream(file)));
-                        wmsLayer.write(oos, images);
+                        wmsLayer.write(oos);
+                        for (GeorefImage img : images) {
+                            oos.writeObject(img);
+                        }
                         oos.close();
                     }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionLoadFromCache.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionLoadFromCache.java	(revision 17718)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionLoadFromCache.java	(revision 17719)
@@ -28,38 +28,40 @@
         nextFile:
         for (File file : files) {
-            String filename = file.getName();
-            String ext = (filename.lastIndexOf(".")==-1)?"":filename.substring(filename.lastIndexOf(".")+1,filename.length());
-            String location = filename.substring(0, filename.lastIndexOf("."));
-            // check the extension and its Lambert zone consistency
-            try {
-                int cacheZone = Integer.parseInt(ext) - 1;
-                if (cacheZone >=0 && cacheZone <= 3) {
-                    if (Lambert.layoutZone == -1) {
-                        Lambert.layoutZone = cacheZone;
-                        System.out.println("Load cache \"" + filename + "\" in Lambert Zone " + (Lambert.layoutZone+1));
-                    } else if (cacheZone != Lambert.layoutZone) {
-                        System.out.println("Cannot load cache \"" + filename + "\" which is not in current Lambert Zone "
-                                + Lambert.layoutZone);
-                        continue nextFile;
-                    } else
-                        System.out.println("Load cache " + filename);
+            if (file.exists()) {
+                String filename = file.getName();
+                String ext = (filename.lastIndexOf(".")==-1)?"":filename.substring(filename.lastIndexOf(".")+1,filename.length());
+                String location = filename.substring(0, filename.lastIndexOf("."));
+                // check the extension and its Lambert zone consistency
+                try {
+                    int cacheZone = Integer.parseInt(ext) - 1;
+                    if (cacheZone >=0 && cacheZone <= 3) {
+                        if (Lambert.layoutZone == -1) {
+                            Lambert.layoutZone = cacheZone;
+                            System.out.println("Load cache \"" + filename + "\" in Lambert Zone " + (Lambert.layoutZone+1));
+                        } else if (cacheZone != Lambert.layoutZone) {
+                            System.out.println("Cannot load cache \"" + filename + "\" which is not in current Lambert Zone "
+                                    + Lambert.layoutZone);
+                            continue nextFile;
+                        } else
+                            System.out.println("Load cache " + filename);
+                    }
+                } catch (NumberFormatException ex) {
+                    System.out.println("Selected file \"" + filename + "\" is not a WMS cache file (invalid extension)");
+                    continue;
                 }
-            } catch (NumberFormatException ex) {
-                System.out.println("Selected file \"" + filename + "\" is not a WMS cache file (invalid extension)");
-                continue;
-            }
-            // check if the selected cache is not already displayed
-            if (Main.map != null) {
-                for (Layer l : Main.map.mapView.getAllLayers()) {
-                    if (l instanceof WMSLayer && l.getName().equals(location)) {
-                        System.out.println("The location " + filename + " is already on screen. Cache not loaded.");
-                        continue nextFile;
+                // check if the selected cache is not already displayed
+                if (Main.map != null) {
+                    for (Layer l : Main.map.mapView.getAllLayers()) {
+                        if (l instanceof WMSLayer && l.getName().equals(location)) {
+                            System.out.println("The location " + filename + " is already on screen. Cache not loaded.");
+                            continue nextFile;
+                        }
                     }
                 }
+                // create layer and load cache
+                WMSLayer wmsLayer = new WMSLayer("", "", Integer.parseInt(ext)-1);
+                if (wmsLayer.getCacheControl().loadCache(file, Lambert.layoutZone))
+                    Main.main.addLayer(wmsLayer);
             }
-            // create layer and load cache
-            WMSLayer wmsLayer = new WMSLayer("", "", Integer.parseInt(ext)-1);
-            if (wmsLayer.getCacheControl().loadCache(file, Lambert.layoutZone))
-                Main.main.addLayer(wmsLayer);
         }
 
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java	(revision 17718)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java	(revision 17719)
@@ -130,7 +130,4 @@
             saveToCache(newImage);
             Main.map.mapView.repaint();
-            /*
-            try { if (dividedBbox.size() > 1) Thread.sleep(1000);
-            } catch (InterruptedException e) {};*/
         }
     }
@@ -346,5 +343,5 @@
      * @throws IOException
      */
-    public void write(ObjectOutputStream oos, ArrayList<GeorefImage> imgs) throws IOException {
+    public void write(ObjectOutputStream oos) throws IOException {
         oos.writeInt(this.serializeFormatVersion);
         oos.writeObject(this.location);
@@ -358,9 +355,4 @@
         }
         oos.writeObject(this.communeBBox);
-        synchronized(this){
-            for (GeorefImage img : imgs) {
-                oos.writeObject(img);
-            }
-        }
     }
 
