Ignore:
Timestamp:
02.08.2009 14:36:40 (3 years ago)
Author:
Gubaer
Message:

towards a fix for #3142: JOSM applet class no longer functional

File:
1 edited

Legend:

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

    r1870 r1879  
    2121import java.util.ArrayList; 
    2222import java.util.Collection; 
     23import java.util.Collections; 
    2324import java.util.HashMap; 
    2425import java.util.Properties; 
     
    268269     * @throws OsmTransferException if something goes wrong 
    269270     */ 
    270     public void deletePrimitive(OsmPrimitive osm) throws OsmTransferException { 
     271    public void deletePrimitive(OsmPrimitive osm, ProgressMonitor monitor) throws OsmTransferException { 
    271272        initialize(); 
    272         // legacy mode does not require payload. normal mode (0.6 and up) requires payload for version matching. 
    273         sendRequest("DELETE", OsmPrimitiveType.from(osm).getAPIName()+"/" + osm.id, version.equals("0.5") ? null : toXml(osm, false)); 
     273        // can't use a the individual DELETE method in the 0.6 API. Java doesn't allow 
     274        // submitting a DELETE request with content, the 0.6 API requires it, however. Falling back 
     275        // to diff upload. 
     276        // 
     277        uploadDiff(Collections.singleton(osm), monitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false)); 
    274278    } 
    275279 
     
    400404        while(true) { // the retry loop 
    401405            try { 
    402                 URL url = new URL(new URL(getBaseUrl()), urlSuffix, new MyHttpHandler()); 
     406                URL url = new URL(new URL(getBaseUrl()), urlSuffix); 
    403407                System.out.print(requestMethod + " " + url + "... "); 
    404408                activeConnection = (HttpURLConnection)url.openConnection(); 
Note: See TracChangeset for help on using the changeset viewer.