Ignore:
Timestamp:
2009-09-13T22:46:45+02:00 (15 years ago)
Author:
Gubaer
Message:

See #3483: "Load list of changesets from the server" is broken for users with non-ASCII usernames

File:
1 edited

Legend:

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

    r2035 r2124  
    1010import java.net.MalformedURLException;
    1111import java.net.URL;
     12import java.nio.charset.CharacterCodingException;
    1213import java.util.zip.GZIPInputStream;
    1314import java.util.zip.Inflater;
     
    3031
    3132    private OsmApi api = OsmApi.getOsmApi();
     33    private boolean doAuthenticate = false;
    3234
    3335    /**
     
    6668            }
    6769
     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            }
    6878            if (Main.pref.getBoolean("osm-server.use-compression", true)) {
    6979                activeConnection.setRequestProperty("Accept-Encoding", "gzip, deflate");
     
    122132    public abstract DataSet parseOsm(ProgressMonitor progressMonitor) throws OsmTransferException;
    123133
     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    }
    124155}
Note: See TracChangeset for help on using the changeset viewer.