Package org.openstreetmap.josm.io
Class OsmServerUserInfoReader
- java.lang.Object
-
- org.openstreetmap.josm.io.OsmConnection
-
- org.openstreetmap.josm.io.OsmServerReader
-
- org.openstreetmap.josm.io.OsmServerUserInfoReader
-
public class OsmServerUserInfoReader extends OsmServerReader
Download and parse info of the logged in user (OSM API v0.6 "/user/details").- See Also:
- /user/details
-
-
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 OsmServerUserInfoReader()
Constructs a newOsmServerUserInfoReader
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UserInfo
buildFromXML(org.w3c.dom.Document document)
Parses the given XML data and returns the associated user info.UserInfo
fetchUserInfo(ProgressMonitor monitor)
Fetches user info, without explicit reason.UserInfo
fetchUserInfo(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
-
OsmServerUserInfoReader
public OsmServerUserInfoReader()
Constructs a newOsmServerUserInfoReader
.
-
-
Method Detail
-
buildFromXML
public static UserInfo buildFromXML(org.w3c.dom.Document document) throws XmlParsingException
Parses the given XML data and returns the associated user info.- Parameters:
document
- The XML contents- Returns:
- The user info
- 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
-
fetchUserInfo
public UserInfo fetchUserInfo(ProgressMonitor monitor) throws OsmTransferException
Fetches user info, without explicit reason.- Parameters:
monitor
- The progress monitor- Returns:
- The user info
- Throws:
OsmTransferException
- if something goes wrong
-
fetchUserInfo
public UserInfo fetchUserInfo(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- Since:
- 6695
-
-