Changeset 29551 in osm for applications/editors/josm/plugins/reverter/src
- Timestamp:
- 2013-05-01T00:35:12+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reverter/src/reverter/ChangesetReverter.java
r29548 r29551 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 4 5 import java.net.HttpURLConnection; 5 6 import java.util.Arrays; 6 7 import java.util.Collections; … … 34 35 import org.openstreetmap.josm.gui.util.GuiHelper; 35 36 import org.openstreetmap.josm.io.MultiFetchServerObjectReader; 37 import org.openstreetmap.josm.io.OsmApiException; 36 38 import org.openstreetmap.josm.io.OsmTransferException; 37 39 … … 186 188 for (HistoryOsmPrimitive entry : collection) { 187 189 PrimitiveId id = entry.getPrimitiveId(); 188 rdr.readObject(id, cds.getEarliestVersion(id)-1, progressMonitor.createSubTaskMonitor(1, true)); 190 int version = cds.getEarliestVersion(id)-1; 191 boolean readOK = false; 192 while (!readOK && version >= 1) { 193 try { 194 rdr.readObject(id, version, progressMonitor.createSubTaskMonitor(1, true)); 195 readOK = true; 196 } catch (OsmApiException e) { 197 if (e.getResponseCode() != HttpURLConnection.HTTP_FORBIDDEN) { 198 throw e; 199 } 200 String message = "Version "+version+" of "+id+" is unauthorized"; 201 if (version > 1) { 202 message += ", requesting previous one"; 203 } 204 Main.info(message); 205 version--; 206 } 207 } 208 if (!readOK) { 209 Main.warn("Cannot retrieve any previous version of "+id); 210 } 189 211 if (progressMonitor.isCanceled()) return; 190 212 }
Note:
See TracChangeset
for help on using the changeset viewer.