org.openstreetmap.josm.io
Class OsmServerReader
java.lang.Object
org.openstreetmap.josm.io.OsmConnection
org.openstreetmap.josm.io.OsmServerReader
- Direct Known Subclasses:
- BoundingBoxDownloader, MultiFetchServerObjectReader, MultiFetchServerObjectReader.Fetcher, OsmServerBackreferenceReader, OsmServerChangesetReader, OsmServerHistoryReader, OsmServerLocationReader, OsmServerObjectReader, OsmServerUserInfoReader
public abstract class OsmServerReader
- extends OsmConnection
This DataReader reads directly from the REST API of the osm server.
It supports plain text transfer as well as gzip or deflate encoded transfers;
if compressed transfers are unwanted, set property osm-server.use-compression
to false.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
api
private OsmApi api
doAuthenticate
private boolean doAuthenticate
OsmServerReader
public OsmServerReader()
getInputStream
protected java.io.InputStream getInputStream(java.lang.String urlStr,
ProgressMonitor progressMonitor)
throws OsmTransferException
- Open a connection to the given url and return a reader on the input stream
from that connection. In case of user cancel, return
null
.
- Parameters:
urlStr
- The exact url to connect to.pleaseWaitDlg
-
- Returns:
- An reader reading the input stream (servers answer) or
null
.
- Throws:
OsmTransferException
getBaseUrl
protected java.lang.String getBaseUrl()
getInputStreamRaw
protected java.io.InputStream getInputStreamRaw(java.lang.String urlStr,
ProgressMonitor progressMonitor)
throws OsmTransferException
- Throws:
OsmTransferException
FixEncoding
private java.io.InputStream FixEncoding(java.io.InputStream stream,
java.lang.String encoding)
throws java.io.IOException
- Throws:
java.io.IOException
parseOsm
public abstract DataSet parseOsm(ProgressMonitor progressMonitor)
throws OsmTransferException
- Throws:
OsmTransferException
parseOsmChange
public DataSet parseOsmChange(ProgressMonitor progressMonitor)
throws OsmTransferException
- Throws:
OsmTransferException
parseOsmChangeBzip2
public DataSet parseOsmChangeBzip2(ProgressMonitor progressMonitor)
throws OsmTransferException
- Throws:
OsmTransferException
parseOsmChangeGzip
public DataSet parseOsmChangeGzip(ProgressMonitor progressMonitor)
throws OsmTransferException
- Throws:
OsmTransferException
parseRawGps
public GpxData parseRawGps(ProgressMonitor progressMonitor)
throws OsmTransferException
- Throws:
OsmTransferException
parseOsmBzip2
public DataSet parseOsmBzip2(ProgressMonitor progressMonitor)
throws OsmTransferException
- Throws:
OsmTransferException
parseOsmGzip
public DataSet parseOsmGzip(ProgressMonitor progressMonitor)
throws OsmTransferException
- Throws:
OsmTransferException
isDoAuthenticate
public boolean isDoAuthenticate()
- Returns true if this reader is adding authentication credentials to the read
request sent to the server.
- Returns:
- true if this reader is adding authentication credentials to the read
request sent to the server
setDoAuthenticate
public void setDoAuthenticate(boolean doAuthenticate)
- Sets whether this reader adds authentication credentials to the read
request sent to the server.
- Parameters:
doAuthenticate
- true if this reader adds authentication credentials to the read
request sent to the server
JOSM