Index: applications/editors/josm/plugins/opendata/build.xml
===================================================================
--- applications/editors/josm/plugins/opendata/build.xml	(revision 29702)
+++ applications/editors/josm/plugins/opendata/build.xml	(revision 29706)
@@ -1,5 +1,5 @@
 ﻿<?xml version="1.0" encoding="utf-8"?>
 <project name="opendata" default="dist" basedir=".">
-    <property name="plugin.main.version" value="5874"/>
+    <property name="plugin.main.version" value="6031"/>
     <property name="plugin.author" value="Don-vip"/>
     <property name="plugin.class" value="org.openstreetmap.josm.plugins.opendata.OdPlugin"/>
Index: applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/actions/DownloadDataTask.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/actions/DownloadDataTask.java	(revision 29702)
+++ applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/actions/DownloadDataTask.java	(revision 29706)
@@ -73,5 +73,5 @@
 			}
 		}
-		for (String ext : new String[]{ZIP_EXT, CSV_EXT, KML_EXT, KMZ_EXT, XLS_EXT, ODS_EXT, SHP_EXT, MIF_EXT, TAB_EXT}) {
+		for (String ext : NetworkReader.FILE_AND_ARCHIVE_READERS.keySet()) {
 			if (Pattern.compile(".*\\."+ext, Pattern.CASE_INSENSITIVE).matcher(url).matches()) {
 				return true;
@@ -81,5 +81,22 @@
 	}
 	
-	protected class InternalDownloadTasK extends DownloadTask {
+    @Override
+    public String[] getPatterns() {
+        String pattern = "";
+        for (String ext : NetworkReader.FILE_AND_ARCHIVE_READERS.keySet()) {
+            if (!pattern.isEmpty()) {
+                pattern += "|";
+            }
+            pattern += "."+ext;
+        }
+        return new String[]{".*(" + pattern + ")"};
+    }
+
+    @Override
+    public String getTitle() {
+        return tr("Download open data");
+    }
+
+    protected class InternalDownloadTasK extends DownloadTask {
 
 		public InternalDownloadTasK(boolean newLayer, NetworkReader reader, ProgressMonitor progressMonitor) {
Index: applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/NetworkReader.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/NetworkReader.java	(revision 29702)
+++ applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/NetworkReader.java	(revision 29706)
@@ -20,4 +20,6 @@
 import java.io.File;
 import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -53,5 +55,27 @@
 	private File file;
 	private String filename;
-	
+    
+    /**
+     * File readers
+     */
+    public static final Map<String, Class<? extends AbstractReader>> FILE_READERS = new HashMap<String, Class<? extends AbstractReader>>();
+    static {
+        FILE_READERS.put(CSV_EXT, CsvReader.class);
+        FILE_READERS.put(KML_EXT, KmlReader.class);
+        FILE_READERS.put(KMZ_EXT, KmzReader.class);
+        FILE_READERS.put(GML_EXT, GmlReader.class);
+        FILE_READERS.put(XLS_EXT, XlsReader.class);
+        FILE_READERS.put(ODS_EXT, OdsReader.class);
+        FILE_READERS.put(SHP_EXT, ShpReader.class);
+        FILE_READERS.put(MIF_EXT, MifReader.class);
+        FILE_READERS.put(TAB_EXT, TabReader.class);
+    }
+    
+    public static final Map<String, Class<? extends AbstractReader>> FILE_AND_ARCHIVE_READERS = new HashMap<String, Class<? extends AbstractReader>>(FILE_READERS);
+    static {
+        FILE_AND_ARCHIVE_READERS.put(ZIP_EXT, ZipReader.class);
+        FILE_AND_ARCHIVE_READERS.put(SEVENZIP_EXT, SevenZipReader.class);
+    }
+
     public NetworkReader(String url, AbstractDataSetHandler handler, boolean promptUser) {
         CheckParameterUtil.ensureParameterNotNull(url, "url");
@@ -76,5 +100,5 @@
 			if (m.matches()) {
 				filename = m.group(1);
-				return findReaderByExtension(filename.toLowerCase());
+				return findReaderByExtension(filename);
 			}
 		}
@@ -105,30 +129,11 @@
 
 	private Class<? extends AbstractReader> findReaderByExtension(String filename) {
-		filename = filename.replace("\"", "");
-    	if (filename.endsWith("."+XLS_EXT)) {
-    		return XlsReader.class;
-    	} else if (filename.endsWith("."+CSV_EXT)) {
-    		return CsvReader.class;
-    	} else if (filename.endsWith("."+ODS_EXT)) {
-    		return OdsReader.class;
-    	} else if (filename.endsWith("."+KML_EXT)) {
-    		return KmlReader.class;
-    	} else if (filename.endsWith("."+KMZ_EXT)) {
-    		return KmzReader.class;
-    	} else if (filename.endsWith("."+MIF_EXT)) {
-    		return MifReader.class;
-    	} else if (filename.endsWith("."+SHP_EXT)) {
-    		return ShpReader.class;
-    	} else if (filename.endsWith("."+TAB_EXT)) {
-    		return TabReader.class;
-    	} else if (filename.endsWith("."+GML_EXT)) {
-    		return GmlReader.class;
-    	} else if (filename.endsWith("."+ZIP_EXT)) {
-    		return ZipReader.class;
-        } else if (filename.endsWith("."+SEVENZIP_EXT)) {
-            return SevenZipReader.class;
-    	} else {
-    		return null;
-    	}
+		filename = filename.replace("\"", "").toLowerCase();
+		for (String ext : FILE_AND_ARCHIVE_READERS.keySet()) {
+		    if (filename.endsWith("."+ext)) {
+		        return FILE_AND_ARCHIVE_READERS.get(ext);
+		    }
+		}
+		return null;
 	}
 
@@ -146,5 +151,5 @@
             }
             if (readerClass == null) {
-                readerClass = findReaderByExtension(url.toLowerCase());
+                readerClass = findReaderByExtension(url);
             }
             if (readerClass == null) {
@@ -153,5 +158,5 @@
             if (readerClass == null) {
            		throw new OsmTransferException("Cannot find appropriate reader !");//TODO handler job ?
-            } else if (findReaderByExtension(url.toLowerCase()) != null) {
+            } else if (findReaderByExtension(url) != null) {
             	filename = url.substring(url.lastIndexOf('/')+1);
             }
Index: applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/archive/ArchiveReader.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/archive/ArchiveReader.java	(revision 29702)
+++ applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/archive/ArchiveReader.java	(revision 29706)
@@ -36,4 +36,5 @@
 import org.openstreetmap.josm.plugins.opendata.core.gui.DialogPrompter;
 import org.openstreetmap.josm.plugins.opendata.core.io.NeptuneReader;
+import org.openstreetmap.josm.plugins.opendata.core.io.NetworkReader;
 import org.openstreetmap.josm.plugins.opendata.core.io.geographic.GmlReader;
 import org.openstreetmap.josm.plugins.opendata.core.io.geographic.KmlReader;
@@ -96,47 +97,7 @@
             }
             
-            if (file == null) {
-                return null;
-            } else if (!file.exists()) {
-                Main.warn("File does not exist: "+file.getPath());
-                return null;
-            } else {
-                DataSet from = null;
-                FileInputStream in = new FileInputStream(file);
-                ProgressMonitor instance = null;
-                if (progressMonitor != null) {
-                    instance = progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false);
-                }
-                if (file.getName().toLowerCase().endsWith(CSV_EXT)) {
-                    from = CsvReader.parseDataSet(in, handler, instance);
-                } else if (file.getName().toLowerCase().endsWith(KML_EXT)) {
-                    from = KmlReader.parseDataSet(in, instance);
-                } else if (file.getName().toLowerCase().endsWith(KMZ_EXT)) {
-                    from = KmzReader.parseDataSet(in, instance);
-                } else if (file.getName().toLowerCase().endsWith(XLS_EXT)) {
-                    from = XlsReader.parseDataSet(in, handler, instance);
-                } else if (file.getName().toLowerCase().endsWith(ODS_EXT)) {
-                    from = OdsReader.parseDataSet(in, handler, instance);
-                } else if (file.getName().toLowerCase().endsWith(SHP_EXT)) {
-                    from = ShpReader.parseDataSet(in, file, handler, instance);
-                } else if (file.getName().toLowerCase().endsWith(MIF_EXT)) {
-                    from = MifReader.parseDataSet(in, file, handler, instance);
-                } else if (file.getName().toLowerCase().endsWith(TAB_EXT)) {
-                    from = TabReader.parseDataSet(in, file, handler, instance);
-                } else if (file.getName().toLowerCase().endsWith(GML_EXT)) {
-                    from = GmlReader.parseDataSet(in, handler, instance);
-                } else if (file.getName().toLowerCase().endsWith(XML_EXT)) {
-                    if (OdPlugin.getInstance().xmlImporter.acceptFile(file)) {
-                        from = NeptuneReader.parseDataSet(in, handler, instance);
-                    } else {
-                        System.err.println("Unsupported XML file: "+file.getName());
-                    }
-                    
-                } else {
-                    System.err.println("Unsupported file extension: "+file.getName());
-                }
-                if (from != null) {
-                    ds = from;
-                }
+            DataSet from = getDataForFile(progressMonitor);
+            if (from != null) {
+                ds = from;
             }
         } catch (IllegalArgumentException e) {
@@ -152,9 +113,53 @@
     }
 
+    protected DataSet getDataForFile(final ProgressMonitor progressMonitor)
+            throws FileNotFoundException, IOException, XMLStreamException, FactoryConfigurationError, JAXBException {
+        if (file == null) {
+            return null;
+        } else if (!file.exists()) {
+            Main.warn("File does not exist: "+file.getPath());
+            return null;
+        } else {
+            DataSet from = null;
+            FileInputStream in = new FileInputStream(file);
+            ProgressMonitor instance = null;
+            if (progressMonitor != null) {
+                instance = progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false);
+            }
+            if (file.getName().toLowerCase().endsWith(CSV_EXT)) {
+                from = CsvReader.parseDataSet(in, handler, instance);
+            } else if (file.getName().toLowerCase().endsWith(KML_EXT)) {
+                from = KmlReader.parseDataSet(in, instance);
+            } else if (file.getName().toLowerCase().endsWith(KMZ_EXT)) {
+                from = KmzReader.parseDataSet(in, instance);
+            } else if (file.getName().toLowerCase().endsWith(XLS_EXT)) {
+                from = XlsReader.parseDataSet(in, handler, instance);
+            } else if (file.getName().toLowerCase().endsWith(ODS_EXT)) {
+                from = OdsReader.parseDataSet(in, handler, instance);
+            } else if (file.getName().toLowerCase().endsWith(SHP_EXT)) {
+                from = ShpReader.parseDataSet(in, file, handler, instance);
+            } else if (file.getName().toLowerCase().endsWith(MIF_EXT)) {
+                from = MifReader.parseDataSet(in, file, handler, instance);
+            } else if (file.getName().toLowerCase().endsWith(TAB_EXT)) {
+                from = TabReader.parseDataSet(in, file, handler, instance);
+            } else if (file.getName().toLowerCase().endsWith(GML_EXT)) {
+                from = GmlReader.parseDataSet(in, handler, instance);
+            } else if (file.getName().toLowerCase().endsWith(XML_EXT)) {
+                if (OdPlugin.getInstance().xmlImporter.acceptFile(file)) {
+                    from = NeptuneReader.parseDataSet(in, handler, instance);
+                } else {
+                    System.err.println("Unsupported XML file: "+file.getName());
+                }
+                
+            } else {
+                System.err.println("Unsupported file extension: "+file.getName());
+            }
+            return from;
+        }
+    }
+
     protected final void lookForCandidate(String entryName, final List<File> candidates, File file) {
         // Test file name to see if it may contain useful data
-        for (String ext : new String[] {
-                CSV_EXT, KML_EXT, KMZ_EXT, XLS_EXT, ODS_EXT, SHP_EXT, MIF_EXT, TAB_EXT, GML_EXT
-        }) {
+        for (String ext : NetworkReader.FILE_READERS.keySet()) {
             if (entryName.toLowerCase().endsWith("."+ext)) {
                 candidates.add(file);
