- Timestamp:
- 2016-12-14T16:13:11+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
r11129 r11399 719 719 try (CachedFile cache = new CachedFile(url); 720 720 InputStream zip = cache.findZipEntryInputStream("validator.mapcss", ""); 721 InputStream s = zip != null ? zip : cache.getInputStream()) { 722 result = TagCheck.readMapCSS(new BufferedReader(UTFInputStreamReader.create(s))); 721 InputStream s = zip != null ? zip : cache.getInputStream(); 722 Reader reader = new BufferedReader(UTFInputStreamReader.create(s))) { 723 result = TagCheck.readMapCSS(reader); 723 724 checks.remove(url); 724 725 checks.putAll(url, result.parseChecks); -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r11374 r11399 904 904 */ 905 905 private static ImageResource getIfAvailableHttp(String url, ImageType type) { 906 CachedFile cf = new CachedFile(url) 907 .setDestDir(new File(Main.pref.getCacheDirectory(), "images").getPath()); 908 try (InputStream is = cf.getInputStream()) { 906 try (CachedFile cf = new CachedFile(url).setDestDir(new File(Main.pref.getCacheDirectory(), "images").getPath()); 907 InputStream is = cf.getInputStream()) { 909 908 switch (type) { 910 909 case SVG: … … 924 923 return img == null ? null : new ImageResource(img); 925 924 default: 926 throw new AssertionError(); 925 throw new AssertionError("Unsupported type: " + type); 927 926 } 928 927 } catch (IOException e) { 929 928 Main.debug(e); 930 929 return null; 931 } finally {932 cf.close();933 930 } 934 931 } … … 1226 1223 parser.setEntityResolver((publicId, systemId) -> new InputSource(new ByteArrayInputStream(new byte[0]))); 1227 1224 1228 CachedFile cf = new CachedFile(base + fn).setDestDir( 1229 new File(Main.pref.getUserDataDirectory(), "images").getPath()); 1230 try (InputStream is = cf.getInputStream()) { 1225 try (CachedFile cf = new CachedFile(base + fn).setDestDir(new File(Main.pref.getUserDataDirectory(), "images").getPath()); 1226 InputStream is = cf.getInputStream()) { 1231 1227 parser.parse(new InputSource(is)); 1232 1228 } 1233 cf.close();1234 1229 } catch (SAXReturnException r) { 1235 1230 Main.trace(r);
Note:
See TracChangeset
for help on using the changeset viewer.