Index: /trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java	(revision 3006)
+++ /trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java	(revision 3007)
@@ -67,33 +67,38 @@
     }
 
-    public InputStream getZipEntry(String extension, String namepart)
-    {
+    /**
+     * Replies an input stream for a file in a ZIP-file. Replies a file in the top
+     * level directory of the ZIP file which has an extension <code>extension</code>. If more
+     * than one files have this extension, the last file whose name includes <code>namepart</code>
+     * is opened.
+     * 
+     * @param extension  the extension of the file we're looking for
+     * @param namepart the name part
+     * @return an input stream. Null if this mirrored input stream doesn't represent a zip file or if
+     * there was no matching file in the ZIP file
+     */
+    public InputStream getZipEntry(String extension, String namepart) {
         InputStream res = null;
         try {
-            if(file != null && (file.getName().endsWith(".zip")
-                    || file.getName().endsWith(".ZIP")))
-            {
-                ZipFile zipFile = new ZipFile(file);
-                ZipEntry resentry = null;
-                Enumeration<? extends ZipEntry> entries = zipFile.entries();
-                while(entries.hasMoreElements()) {
-                    ZipEntry entry = entries.nextElement();
-                    if(entry.getName().endsWith("."+extension)) {
-                        /* choose any file with correct extension. When more than
+            ZipFile zipFile = new ZipFile(file);
+            ZipEntry resentry = null;
+            Enumeration<? extends ZipEntry> entries = zipFile.entries();
+            while (entries.hasMoreElements()) {
+                ZipEntry entry = entries.nextElement();
+                if (entry.getName().endsWith("." + extension)) {
+                    /* choose any file with correct extension. When more than
                         one file, prefer the one which matches namepart */
-                        if(resentry == null || entry.getName().indexOf(namepart) >= 0) {
-                            resentry = entry;
-                        }
+                    if (resentry == null || entry.getName().indexOf(namepart) >= 0) {
+                        resentry = entry;
                     }
                 }
-                if(resentry != null) {
-                    res = zipFile.getInputStream(resentry);
-                }
-                else {
-                    zipFile.close();
-                }
+            }
+            if (resentry != null) {
+                res = zipFile.getInputStream(resentry);
+            } else {
+                zipFile.close();
             }
         } catch (Exception e) {
-            System.err.println(tr("Warning: failed to handle zip file ''{0}''. Exception was: {1}", file.getName(), e.toString()));
+            System.err.println(tr("Warning: failed to open file with extension ''{2}'' and namepart ''{3}'' in zip file ''{0}''. Exception was: {1}", file.getName(), e.toString(), extension, namepart));
         }
         return res;
