Changeset 1146 in josm for trunk/src/org/openstreetmap/josm/io
- Timestamp:
- 2008-12-19T14:43:36+01:00 (17 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io
- Files:
-
- 1 added
- 2 edited
-
OsmServerLocationReader.java (added)
-
OsmServerObjectReader.java (modified) (2 diffs)
-
OsmServerReader.java (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmServerObjectReader.java
r1071 r1146 17 17 public final static String TYPE_NODE = "node"; 18 18 19 long id; 20 String type; 21 boolean full; 22 23 public OsmServerObjectReader(long id, String type, boolean full) { 24 this.id = id; 25 this.type = type; 26 this.full = full; 27 } 19 28 /** 20 29 * Method to download single objects from OSM server. ways, relations, nodes … … 26 35 * @throws IOException 27 36 */ 28 public DataSet parseOsm( long id, String type, boolean full) throws SAXException, IOException {37 public DataSet parseOsm() throws SAXException, IOException { 29 38 try { 30 31 39 Main.pleaseWaitDlg.progress.setValue(0); 32 40 Main.pleaseWaitDlg.currentAction.setText(tr("Contacting OSM Server...")); -
trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
r1071 r1146 13 13 14 14 import org.openstreetmap.josm.Main; 15 import org.openstreetmap.josm.data.osm.DataSet; 15 16 import org.openstreetmap.josm.gui.PleaseWaitDialog; 17 import org.xml.sax.SAXException; 16 18 17 19 /** … … 24 26 * @author imi 25 27 */ 26 abstract class OsmServerReader extends OsmConnection { 28 public abstract class OsmServerReader extends OsmConnection { 27 29 /** 28 30 * Open a connection to the given url and return a reader on the input stream … … 35 37 String version = Main.pref.get("osm-server.version", "0.5"); 36 38 urlStr = Main.pref.get("osm-server.url")+"/"+version+"/" + urlStr; 39 return getInputStreamRaw(urlStr, pleaseWaitDlg); 40 } 41 42 protected InputStream getInputStreamRaw(String urlStr, PleaseWaitDialog pleaseWaitDlg) throws IOException { 43 37 44 System.out.println("download: "+urlStr); 38 45 initAuthentication(); … … 50 57 if (isAuthCancelled() && activeConnection.getResponseCode() == 401) 51 58 return null; 52 if (activeConnection.getResponseCode() == 500)59 if (activeConnection.getResponseCode() == 500) 53 60 { 54 61 throw new IOException(tr("Server returned internal error. Try a reduced area or retry after waiting some time.")); … … 66 73 return inputStream; 67 74 } 75 76 public abstract DataSet parseOsm() throws SAXException, IOException; 77 68 78 }
Note:
See TracChangeset
for help on using the changeset viewer.
