@Test public void testASDIParsing() throws Exception { WMTSCapabilities caps = WMTSCapabilitiesParser.parseCapabilities(capabilitiesInput_ASDI); Set<String> crss = new HashSet<>(); crss.add("EPSG:3575"); OskariLayer layer = new OskariLayer(); layer.setId(1); layer.setName("arcticsdi_wmts"); JSONObject options = layer.getOptions(); options.put("format", "REST"); assertTrue(options.has("format")); OskariLayerCapabilitiesHelper.setPropertiesFromCapabilitiesWMTS(caps, layer, crss); assertFalse("'format' value should have been removed since the layer doesn't support RESTful WMTS", options.has("format")); }
public static WMTSCapabilities parseCapabilities(String xml) throws IllegalArgumentException, XMLStreamException { OMElement doc = XmlHelper.parseXML(xml); if (doc == null) { throw new XMLStreamException("Failed to parse XML"); } return parseCapabilities(doc); }
WMTSCapabilitiesParser { public static WMTSCapabilities parseCapabilities(String xml) throws IllegalArgumentException, XMLStreamException { OMElement doc = XmlHelper.parseXML(xml); if (doc == null) { throw new XMLStreamException("Failed to parse XML"); } return parseCapabilities(doc); } }
WMTSCapabilitiesParser { public static WMTSCapabilities parseCapabilities(String xml) throws IllegalArgumentException, XMLStreamException { OMElement doc = XmlHelper.parseXML(xml); if (doc == null) { throw new XMLStreamException("Failed to parse XML"); } return parseCapabilities(doc); }  }
WMTSCapabilitiesParser { public static WMTSCapabilities parseCapabilities(String xml) throws IllegalArgumentException, XMLStreamException { OMElement doc = XmlHelper.parseXML(xml); if (doc == null) { throw new XMLStreamException("Failed to parse XML"); } return parseCapabilities(doc); }  static WMTSCapabilities parseCapabilities(String xml); static WMTSCapabilities parseCapabilities(InputStream in); static WMTSCapabilities parseCapabilities(OMElement doc); static JSONObject asJSON(WMTSCapabilities caps, String url, String currentCrs); }
WMTSCapabilitiesParser { public static WMTSCapabilities parseCapabilities(String xml) throws IllegalArgumentException, XMLStreamException { OMElement doc = XmlHelper.parseXML(xml); if (doc == null) { throw new XMLStreamException("Failed to parse XML"); } return parseCapabilities(doc); }  static WMTSCapabilities parseCapabilities(String xml); static WMTSCapabilities parseCapabilities(InputStream in); static WMTSCapabilities parseCapabilities(OMElement doc); static JSONObject asJSON(WMTSCapabilities caps, String url, String currentCrs);  }