Package org.openstreetmap.josm.io
Class OsmServerUserPreferencesReader
- java.lang.Object
-
- org.openstreetmap.josm.io.OsmConnection
-
- org.openstreetmap.josm.io.OsmServerReader
-
- org.openstreetmap.josm.io.OsmServerUserPreferencesReader
-
public class OsmServerUserPreferencesReader extends OsmServerReader
Download and parse preferences of the logged in user (OSM API v0.6 "/user/preferences").- Since:
- 12502
- See Also:
- /user/preferences
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.io.OsmServerReader
OsmServerReader.DomParser<R>
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.io.OsmConnection
OsmConnection.OAuthAccessTokenFetcher
-
-
Field Summary
-
Fields inherited from class org.openstreetmap.josm.io.OsmServerReader
contentType, gpxParsedProperly
-
Fields inherited from class org.openstreetmap.josm.io.OsmConnection
activeConnection, cancel, fetcher, oAuth20Parameters
-
-
Constructor Summary
Constructors Constructor Description OsmServerUserPreferencesReader()
Constructs a newOsmServerUserInfoReader
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.Map<java.lang.String,java.lang.String>
buildFromXML(org.w3c.dom.Document document)
Parses the given XML data and returns the associated user preferences.java.util.Map<java.lang.String,java.lang.String>
fetchUserPreferences(ProgressMonitor monitor)
Fetches user preferences, without explicit reason.java.util.Map<java.lang.String,java.lang.String>
fetchUserPreferences(ProgressMonitor monitor, java.lang.String reason)
Fetches user info, with an explicit reason.DataSet
parseOsm(ProgressMonitor progressMonitor)
Download OSM files from somewhere-
Methods inherited from class org.openstreetmap.josm.io.OsmServerReader
adaptRequest, fetchData, getAttribute, getBaseUrl, getInputStream, getInputStream, getInputStreamRaw, getInputStreamRaw, getInputStreamRaw, getInputStreamRaw, isDoAuthenticate, isGpxParsedProperly, parseNotes, parseOsm, parseOsmChange, parseOsmChange, parseRawGps, parseRawGps, parseRawNotes, parseRawNotes, setDoAuthenticate
-
Methods inherited from class org.openstreetmap.josm.io.OsmConnection
addAuth, addBasicAuthorizationHeader, addOAuth20AuthorizationHeader, cancel, isCanceled, retrieveBasicAuthorizationLogin, setOAuthAccessTokenFetcher
-
-
-
-
Constructor Detail
-
OsmServerUserPreferencesReader
public OsmServerUserPreferencesReader()
Constructs a newOsmServerUserInfoReader
.
-
-
Method Detail
-
buildFromXML
public static java.util.Map<java.lang.String,java.lang.String> buildFromXML(org.w3c.dom.Document document) throws XmlParsingException
Parses the given XML data and returns the associated user preferences.- Parameters:
document
- The XML contents- Returns:
- The user preferences
- Throws:
XmlParsingException
- if parsing goes wrong
-
parseOsm
public DataSet parseOsm(ProgressMonitor progressMonitor) throws OsmTransferException
Description copied from class:OsmServerReader
Download OSM files from somewhere- Specified by:
parseOsm
in classOsmServerReader
- Parameters:
progressMonitor
- The progress monitor- Returns:
- The corresponding dataset
- Throws:
OsmTransferException
- if any error occurs
-
fetchUserPreferences
public java.util.Map<java.lang.String,java.lang.String> fetchUserPreferences(ProgressMonitor monitor) throws OsmTransferException
Fetches user preferences, without explicit reason.- Parameters:
monitor
- The progress monitor- Returns:
- The user preferences
- Throws:
OsmTransferException
- if something goes wrong
-
fetchUserPreferences
public java.util.Map<java.lang.String,java.lang.String> fetchUserPreferences(ProgressMonitor monitor, java.lang.String reason) throws OsmTransferException
Fetches user info, with an explicit reason.- Parameters:
monitor
- The progress monitorreason
- The reason to show on console. Can benull
if no reason is given- Returns:
- The user info
- Throws:
OsmTransferException
- if something goes wrong
-
-