Changeset 14367 in josm


Ignore:
Timestamp:
2018-10-26T22:12:10+02:00 (5 years ago)
Author:
Don-vip
Message:

fix #16897 - catch InvalidPathException for invalid WMS GetCapabilities URL

Location:
trunk/src/org/openstreetmap/josm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java

    r14214 r14367  
    1111import java.io.IOException;
    1212import java.net.MalformedURLException;
     13import java.nio.file.InvalidPathException;
    1314import java.util.Collection;
    1415import java.util.Collections;
     
    169170     * @throws IOException if any I/O error occurs while contacting the WMS endpoint
    170171     * @throws WMSGetCapabilitiesException if the WMS getCapabilities request fails
     172     * @throws InvalidPathException if a Path object cannot be constructed for the capabilities cached file
    171173     */
    172174    protected static ImageryInfo getWMSLayerInfo(ImageryInfo info) throws IOException, WMSGetCapabilitiesException {
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java

    r14184 r14367  
    77import java.io.IOException;
    88import java.net.MalformedURLException;
     9import java.nio.file.InvalidPathException;
    910import java.util.Collection;
    1011import java.util.List;
     
    8889                formats.setModel(new DefaultComboBoxModel<>(wmsFormats.toArray(new String[0])));
    8990                formats.setSelectedItem(wms.getPreferredFormat());
    90             } catch (MalformedURLException ex1) {
     91            } catch (MalformedURLException | InvalidPathException ex1) {
    9192                Logging.log(Logging.LEVEL_ERROR, ex1);
    9293                JOptionPane.showMessageDialog(getParent(), tr("Invalid service URL."),
  • trunk/src/org/openstreetmap/josm/io/CachedFile.java

    r14149 r14367  
    1616import java.nio.charset.StandardCharsets;
    1717import java.nio.file.Files;
     18import java.nio.file.InvalidPathException;
    1819import java.nio.file.StandardCopyOption;
    1920import java.security.MessageDigest;
     
    219220     * @return the InputStream
    220221     * @throws IOException when the resource with the given name could not be retrieved
     222     * @throws InvalidPathException if a Path object cannot be constructed from the inner file path
    221223     */
    222224    public InputStream getInputStream() throws IOException {
  • trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java

    r13883 r14367  
    1010import java.net.MalformedURLException;
    1111import java.net.URL;
     12import java.nio.file.InvalidPathException;
    1213import java.util.ArrayList;
    1314import java.util.Collection;
     
    133134     * @throws IOException when connection error when fetching get capabilities document
    134135     * @throws WMSGetCapabilitiesException when there are errors when parsing get capabilities document
     136     * @throws InvalidPathException if a Path object cannot be constructed for the capabilities cached file
    135137     */
    136138    public WMSImagery(String url) throws IOException, WMSGetCapabilitiesException {
     
    144146     * @throws IOException when connection error when fetching get capabilities document
    145147     * @throws WMSGetCapabilitiesException when there are errors when parsing get capabilities document
     148     * @throws InvalidPathException if a Path object cannot be constructed for the capabilities cached file
    146149     */
    147150    public WMSImagery(String url, Map<String, String> headers) throws IOException, WMSGetCapabilitiesException {
Note: See TracChangeset for help on using the changeset viewer.