Changeset 13204 in josm for trunk/src/org/openstreetmap/josm/plugins
- Timestamp:
- 2017-12-17T00:17:20+01:00 (3 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java
r12620 r13204 5 5 6 6 import java.io.File; 7 import java.io.FileInputStream;8 7 import java.io.IOException; 9 8 import java.io.InputStream; 10 9 import java.lang.reflect.Constructor; 11 10 import java.net.URL; 11 import java.nio.file.Files; 12 import java.nio.file.InvalidPathException; 12 13 import java.text.MessageFormat; 13 14 import java.util.ArrayList; … … 114 115 this.file = file; 115 116 try ( 116 FileInputStream fis = new FileInputStream(file);117 InputStream fis = Files.newInputStream(file.toPath()); 117 118 JarInputStream jar = new JarInputStream(fis) 118 119 ) { … … 122 123 scanManifest(manifest, false); 123 124 libraries.add(0, Utils.fileToURL(file)); 124 } catch (IOException e) {125 } catch (IOException | InvalidPathException e) { 125 126 throw new PluginException(name, e); 126 127 } -
trunk/src/org/openstreetmap/josm/plugins/ReadLocalPluginInformationTask.java
r12620 r13204 5 5 6 6 import java.io.File; 7 import java.io.FileInputStream;8 7 import java.io.FilenameFilter; 9 8 import java.io.IOException; 9 import java.io.InputStream; 10 import java.nio.file.Files; 11 import java.nio.file.InvalidPathException; 10 12 import java.util.ArrayList; 11 13 import java.util.Collection; … … 145 147 146 148 protected void processLocalPluginInformationFile(File file) throws PluginListParseException { 147 try ( FileInputStream fin = new FileInputStream(file)) {149 try (InputStream fin = Files.newInputStream(file.toPath())) { 148 150 List<PluginInformation> pis = new PluginListParser().parse(fin); 149 151 for (PluginInformation pi : pis) { … … 154 156 availablePlugins.put(pi.name, pi); 155 157 } 156 } catch (IOException e) {158 } catch (IOException | InvalidPathException e) { 157 159 throw new PluginListParseException(e); 158 160 }
Note: See TracChangeset
for help on using the changeset viewer.