public class ImageryReader extends java.lang.Object implements java.io.Closeable
The format is specified in the JOSM wiki.
| Modifier and Type | Class and Description |
|---|---|
private static class |
ImageryReader.Parser |
private static class |
ImageryReader.State |
| Modifier and Type | Field and Description |
|---|---|
private CachedFile |
cachedFile |
private boolean |
fastFail |
private java.lang.String |
source |
| Constructor and Description |
|---|
ImageryReader(java.lang.String source)
Constructs a
ImageryReader from a given filename, URL or internal resource. |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
java.util.List<ImageryInfo> |
parse()
Parses imagery source.
|
void |
setFastFail(boolean fastFail)
Sets whether opening HTTP connections should fail fast, i.e., whether a
low connect timeout should be used. |
private final java.lang.String source
private CachedFile cachedFile
private boolean fastFail
public ImageryReader(java.lang.String source)
ImageryReader from a given filename, URL or internal resource.source - can be:file:///SOME/FILE the same as abovehttp://... a URL. It will be cached on disk.resource://SOME/FILE file from the classpath (usually in the current *.jar)josmdir://SOME/FILE file inside josm user data directory (since r7058)josmplugindir://SOME/FILE file inside josm plugin directory (since r7834)public java.util.List<ImageryInfo> parse() throws org.xml.sax.SAXException, java.io.IOException
org.xml.sax.SAXException - if any SAX error occursjava.io.IOException - if any I/O error occurspublic void setFastFail(boolean fastFail)
low connect timeout should be used.fastFail - whether opening HTTP connections should fail fastCachedFile.setFastFail(boolean)public void close() throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOException