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/gui/oauth/OsmOAuthAuthorizationClient.java

    r5587 r5874  
    405405            dout.writeBytes(request);
    406406            dout.flush();
    407             dout.close();
     407            Utils.close(dout);
    408408
    409409            // after a successful login the OSM website sends a redirect to a follow up page. Everything
     
    419419            throw new OsmLoginFailedException(e);
    420420        } finally {
    421             if (dout != null) {
    422                 try {
    423                     dout.close();
    424                 } catch(IOException e) { /* ignore */ }
    425             }
     421            Utils.close(dout);
    426422            synchronized(this) {
    427423                connection = null;
     
    496492            dout.writeBytes(request);
    497493            dout.flush();
    498             dout.close();
    499494
    500495            int retCode = connection.getResponseCode();
     
    506501            throw new OsmOAuthAuthorizationException(e);
    507502        } finally {
    508             if (dout != null) {
    509                 try {
    510                     dout.close();
    511                 } catch(IOException e) { /* ignore */ }
    512             }
     503            Utils.close(dout);
    513504            synchronized(this) {
    514505                connection = null;
Note: See TracChangeset for help on using the changeset viewer.