Changeset 19106 in josm for trunk/src/org/openstreetmap/josm/gui/animation
- Timestamp:
- 2024-06-13T21:18:45+02:00 (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/animation/DropImage.java
r18932 r19106 9 9 import java.net.URL; 10 10 import java.net.URLDecoder; 11 import java.nio.charset.StandardCharsets; 11 12 import java.util.ArrayList; 12 13 import java.util.Enumeration; … … 71 72 String path = "images/presets/"; 72 73 URL url = DropImage.class.getClassLoader().getResource(path); 73 if (url != null && url.getProtocol() .equals("file")) {74 if (url != null && "file".equals(url.getProtocol())) { 74 75 ArrayList<File> dirs = new ArrayList<>(); 75 76 dirs.add(new File(url.toURI())); … … 87 88 } while (!dirs.isEmpty()); 88 89 name = result.get(seed.nextInt(result.size())); 89 } else if (url != null && url.getProtocol() .equals("jar")) {90 String jarPath = url.getPath().substring(5, url.getPath().indexOf( "!"));91 try (JarFile jar = new JarFile(URLDecoder.decode(jarPath, "UTF-8"))) {90 } else if (url != null && "jar".equals(url.getProtocol())) { 91 String jarPath = url.getPath().substring(5, url.getPath().indexOf('!')); 92 try (JarFile jar = new JarFile(URLDecoder.decode(jarPath, StandardCharsets.UTF_8))) { 92 93 Enumeration<JarEntry> entries = jar.entries(); 93 94 while (entries.hasMoreElements()) {
Note:
See TracChangeset
for help on using the changeset viewer.