Changeset 9174 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2015-12-27T00:07:00+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
r9172 r9174 152 152 } 153 153 154 activeConnection.uncompressAccordingToContentDisposition(uncompressAccordingToContentDisposition); 154 155 InputStream in = new ProgressInputStream(activeConnection, progressMonitor); 155 if (uncompressAccordingToContentDisposition) {156 activeConnection.uncompressAccordingToContentDisposition(true);157 }158 156 return in; 159 157 } catch (OsmTransferException e) { -
trunk/src/org/openstreetmap/josm/tools/HttpClient.java
r9173 r9174 183 183 } 184 184 in = "gzip".equalsIgnoreCase(getContentEncoding()) ? new GZIPInputStream(in) : in; 185 Compression compression = Compression.NONE; 185 186 if (uncompress) { 186 187 final String contentType = getContentType(); 187 188 Main.debug("Uncompressing input stream according to Content-Type header: {0}", contentType); 188 in = Compression.forContentType(contentType).getUncompressedInputStream(in);189 } 190 if (uncompressAccordingToContentDisposition ) {189 compression = Compression.forContentType(contentType); 190 } 191 if (uncompressAccordingToContentDisposition && Compression.NONE.equals(compression)) { 191 192 final String contentDisposition = getHeaderField("Content-Disposition"); 192 193 final Matcher matcher = Pattern.compile("filename=\"([^\"]+)\"").matcher(contentDisposition); 193 194 if (matcher.find()) { 194 195 Main.debug("Uncompressing input stream according to Content-Disposition header: {0}", contentDisposition); 195 in = Compression.byExtension(matcher.group(1)).getUncompressedInputStream(in);196 compression = Compression.byExtension(matcher.group(1)); 196 197 } 197 198 } 199 in = compression.getUncompressedInputStream(in); 198 200 return in; 199 201 }
Note:
See TracChangeset
for help on using the changeset viewer.