Class ImageryReader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class ImageryReader
    extends java.lang.Object
    implements java.io.Closeable
    Reader to parse the list of available imagery servers from an XML definition file.

    The format is specified in the JOSM wiki.

    • Constructor Summary

      Constructors 
      Constructor Description
      ImageryReader​(java.lang.String source)
      Constructs a ImageryReader from a given filename, URL or internal resource.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ImageryReader

        public ImageryReader​(java.lang.String source)
        Constructs a ImageryReader from a given filename, URL or internal resource.
        Parameters:
        source - can be:
        • relative or absolute file name
        • file:///SOME/FILE the same as above
        • http://... 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)
    • Method Detail

      • parse

        public java.util.List<ImageryInfoparse()
                                          throws org.xml.sax.SAXException,
                                                 java.io.IOException
        Parses imagery source.
        Returns:
        list of imagery info
        Throws:
        org.xml.sax.SAXException - if any SAX error occurs
        java.io.IOException - if any I/O error occurs
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException