Changeset 13254 in josm for trunk/src


Ignore:
Timestamp:
2017-12-28T19:51:02+01:00 (6 years ago)
Author:
Don-vip
Message:

see #15310 - remove deprecated ProgressInputStream constructor

File:
1 edited

Legend:

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

    r12622 r13254  
    66import java.io.IOException;
    77import java.io.InputStream;
    8 import java.net.URLConnection;
    98import java.util.Optional;
    109
     
    3534                Optional.ofNullable(progressMonitor).orElse(NullProgressMonitor.INSTANCE), tr("Downloading data..."));
    3635        this.in = in;
    37     }
    38 
    39     /**
    40      * Constructs a new {@code ProgressInputStream}.
    41      *
    42      * Will call {@link URLConnection#getInputStream()} to obtain the stream to monitor.
    43      *
    44      * @param con the connection to monitor
    45      * @param progressMonitor the monitor to report to
    46      * @throws OsmTransferException if any I/O error occurs
    47      * @deprecated use {@link org.openstreetmap.josm.tools.HttpClient.Response#getContent}
    48      */
    49     @Deprecated
    50     public ProgressInputStream(URLConnection con, ProgressMonitor progressMonitor) throws OsmTransferException {
    51         if (progressMonitor == null) {
    52             progressMonitor = NullProgressMonitor.INSTANCE;
    53         }
    54         progressMonitor.beginTask(tr("Contacting OSM Server..."), 1);
    55         progressMonitor.indeterminateSubTask(null);
    56 
    57         try {
    58             this.in = con.getInputStream();
    59             this.updater = new StreamProgressUpdater(con.getContentLength(), progressMonitor, tr("Downloading data..."));
    60         } catch (IOException e) {
    61             progressMonitor.finishTask();
    62             if (con.getHeaderField("Error") != null)
    63                 throw new OsmTransferException(tr(con.getHeaderField("Error")), e);
    64             throw new OsmTransferException(e);
    65         }
    6636    }
    6737
Note: See TracChangeset for help on using the changeset viewer.