Index: /trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java	(revision 14366)
+++ /trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java	(revision 14367)
@@ -11,4 +11,5 @@
 import java.io.IOException;
 import java.net.MalformedURLException;
+import java.nio.file.InvalidPathException;
 import java.util.Collection;
 import java.util.Collections;
@@ -169,4 +170,5 @@
      * @throws IOException if any I/O error occurs while contacting the WMS endpoint
      * @throws WMSGetCapabilitiesException if the WMS getCapabilities request fails
+     * @throws InvalidPathException if a Path object cannot be constructed for the capabilities cached file
      */
     protected static ImageryInfo getWMSLayerInfo(ImageryInfo info) throws IOException, WMSGetCapabilitiesException {
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java	(revision 14366)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java	(revision 14367)
@@ -7,4 +7,5 @@
 import java.io.IOException;
 import java.net.MalformedURLException;
+import java.nio.file.InvalidPathException;
 import java.util.Collection;
 import java.util.List;
@@ -88,5 +89,5 @@
                 formats.setModel(new DefaultComboBoxModel<>(wmsFormats.toArray(new String[0])));
                 formats.setSelectedItem(wms.getPreferredFormat());
-            } catch (MalformedURLException ex1) {
+            } catch (MalformedURLException | InvalidPathException ex1) {
                 Logging.log(Logging.LEVEL_ERROR, ex1);
                 JOptionPane.showMessageDialog(getParent(), tr("Invalid service URL."),
Index: /trunk/src/org/openstreetmap/josm/io/CachedFile.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/CachedFile.java	(revision 14366)
+++ /trunk/src/org/openstreetmap/josm/io/CachedFile.java	(revision 14367)
@@ -16,4 +16,5 @@
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
+import java.nio.file.InvalidPathException;
 import java.nio.file.StandardCopyOption;
 import java.security.MessageDigest;
@@ -219,4 +220,5 @@
      * @return the InputStream
      * @throws IOException when the resource with the given name could not be retrieved
+     * @throws InvalidPathException if a Path object cannot be constructed from the inner file path
      */
     public InputStream getInputStream() throws IOException {
Index: /trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java	(revision 14366)
+++ /trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java	(revision 14367)
@@ -10,4 +10,5 @@
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.nio.file.InvalidPathException;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -133,4 +134,5 @@
      * @throws IOException when connection error when fetching get capabilities document
      * @throws WMSGetCapabilitiesException when there are errors when parsing get capabilities document
+     * @throws InvalidPathException if a Path object cannot be constructed for the capabilities cached file
      */
     public WMSImagery(String url) throws IOException, WMSGetCapabilitiesException {
@@ -144,4 +146,5 @@
      * @throws IOException when connection error when fetching get capabilities document
      * @throws WMSGetCapabilitiesException when there are errors when parsing get capabilities document
+     * @throws InvalidPathException if a Path object cannot be constructed for the capabilities cached file
      */
     public WMSImagery(String url, Map<String, String> headers) throws IOException, WMSGetCapabilitiesException {
