Changeset 2124 in josm for trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
- Timestamp:
- 2009-09-13T22:46:45+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
r2035 r2124 10 10 import java.net.MalformedURLException; 11 11 import java.net.URL; 12 import java.nio.charset.CharacterCodingException; 12 13 import java.util.zip.GZIPInputStream; 13 14 import java.util.zip.Inflater; … … 30 31 31 32 private OsmApi api = OsmApi.getOsmApi(); 33 private boolean doAuthenticate = false; 32 34 33 35 /** … … 66 68 } 67 69 70 try { 71 if (doAuthenticate) { 72 addAuth(activeConnection); 73 } 74 } catch(CharacterCodingException e) { 75 System.err.println(tr("Error: failed to add authentication credentials to the connection.")); 76 throw new OsmTransferException(e); 77 } 68 78 if (Main.pref.getBoolean("osm-server.use-compression", true)) { 69 79 activeConnection.setRequestProperty("Accept-Encoding", "gzip, deflate"); … … 122 132 public abstract DataSet parseOsm(ProgressMonitor progressMonitor) throws OsmTransferException; 123 133 134 /** 135 * Returns true if this reader is adding authentication credentials to the read 136 * request sent to the server. 137 * 138 * @return true if this reader is adding authentication credentials to the read 139 * request sent to the server 140 */ 141 public boolean isDoAuthenticate() { 142 return doAuthenticate; 143 } 144 145 /** 146 * Sets whether this reader adds authentication credentials to the read 147 * request sent to the server. 148 * 149 * @param doAuthenticate true if this reader adds authentication credentials to the read 150 * request sent to the server 151 */ 152 public void setDoAuthenticate(boolean doAuthenticate) { 153 this.doAuthenticate = doAuthenticate; 154 } 124 155 }
Note:
See TracChangeset
for help on using the changeset viewer.