Changeset 30738 in osm for applications/editors/josm/plugins/piclayer/src
- Timestamp:
- 2014-10-19T01:27:04+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerFromFile.java
r30436 r30738 74 74 75 75 if (isZip) { 76 ZipFile zipFile = null; 77 try 78 { 79 zipFile = new ZipFile(m_file); 76 try (ZipFile zipFile = new ZipFile(m_file)) { 80 77 ZipEntry imgEntry = null; 81 78 Enumeration<? extends ZipEntry> entries = zipFile.entries(); … … 103 100 System.err.println(tr("Warning: failed to handle zip file ''{0}''. Exception was: {1}", m_file.getName(), e.toString())); 104 101 return null; 105 } finally {106 if (zipFile != null) {107 try {108 zipFile.close();109 } catch (IOException ex) {110 }111 }112 102 } 113 103 } else { … … 149 139 150 140 if (isZip) { 151 ZipFile zipFile = null; 152 try 153 { 154 zipFile = new ZipFile(m_file); 141 try (ZipFile zipFile = new ZipFile(m_file)) { 155 142 String calFileStr = imgNameInZip + CalibrationFileFilter.EXTENSION; 156 143 ZipEntry calEntry = zipFile.getEntry(calFileStr); … … 183 170 } 184 171 } catch (Exception e) { 185 System.err.println(tr("Warning: failed to handle zip file ''{0}''. Exception was: {1}", m_file.getName(), e.toString()));172 Main.warn(tr("Warning: failed to handle zip file ''{0}''. Exception was: {1}", m_file.getName(), e.toString())); 186 173 return; 187 } finally {188 if (zipFile != null) {189 try {190 zipFile.close();191 } catch (IOException ex) {192 }193 }194 174 } 195 175 } else {
Note:
See TracChangeset
for help on using the changeset viewer.