Ignore:
Timestamp:
2013-04-16T19:57:43+02:00 (11 years ago)
Author:
Don-vip
Message:

see #8570, #7406 - I/O refactorization:

  • Move different file copy functions to Utils.copyFile (to be replaced later by Files.copy when switching to Java 7)
  • Replace all Utils.close(XXX) by Utils.close(Closeable) -> impacted plugins: commandline, mirrored_download, opendata, piclayer
  • Add new Utils.close(ZipFile)
  • Use of Utils.close almost everywhere
  • Javadoc fixes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java

    r5868 r5874  
    124124                res = zipFile.getInputStream(resentry);
    125125            } else {
    126                 zipFile.close();
     126                Utils.close(zipFile);
    127127            }
    128128        } catch (Exception e) {
     
    224224                bos.write(buffer, 0, length);
    225225            }
    226             bos.close();
     226            Utils.close(bos);
    227227            bos = null;
    228228            /* close fos as well to be sure! */
    229             fos.close();
     229            Utils.close(fos);
    230230            fos = null;
    231231            localFile = new File(destDir, localPath);
     
    304304    @Override
    305305    public void close() throws IOException
    306     { fs.close(); }
     306    { Utils.close(fs); }
    307307    @Override
    308308    public int read() throws IOException
Note: See TracChangeset for help on using the changeset viewer.