Index: trunk/src/org/openstreetmap/josm/io/Compression.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/Compression.java	(revision 9168)
+++ trunk/src/org/openstreetmap/josm/io/Compression.java	(revision 9169)
@@ -50,4 +50,22 @@
                 ? ZIP
                 : NONE;
+    }
+
+    /**
+     * Determines the compression type based on the content type (MIME type).
+     * @param contentType the content type
+     * @return the compression type
+     */
+    public static Compression forContentType(String contentType) {
+        switch (contentType) {
+        case "application/zip":
+            return ZIP;
+        case "application/x-gzip":
+            return GZIP;
+        case "application/x-bzip2":
+            return BZIP2;
+        default:
+            return NONE;
+        }
     }
 
Index: trunk/src/org/openstreetmap/josm/tools/HttpClient.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/HttpClient.java	(revision 9168)
+++ trunk/src/org/openstreetmap/josm/tools/HttpClient.java	(revision 9169)
@@ -19,4 +19,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Version;
+import org.openstreetmap.josm.io.Compression;
 
 /**
@@ -115,8 +116,20 @@
         private final HttpURLConnection connection;
         private final int responseCode;
+        private boolean uncompress;
 
         private Response(HttpURLConnection connection) throws IOException {
             this.connection = connection;
             this.responseCode = connection.getResponseCode();
+        }
+
+        /**
+         * Sets whether {@link #getContent()} should uncompress the input stream if necessary.
+         *
+         * @param uncompress whether the input stream should be uncompressed if necessary
+         * @return {@code this}
+         */
+        public Response uncompress(boolean uncompress) {
+            this.uncompress = uncompress;
+            return this;
         }
 
@@ -135,5 +148,10 @@
                 in = connection.getErrorStream();
             }
-            return "gzip".equalsIgnoreCase(getContentEncoding()) ? new GZIPInputStream(in) : in;
+            in = "gzip".equalsIgnoreCase(getContentEncoding()) ? new GZIPInputStream(in) : in;
+            if (uncompress) {
+                return Compression.forContentType(getContentType()).getUncompressedInputStream(in);
+            } else {
+                return in;
+            }
         }
 
