legacy/src/main/java/thredds/catalog/util/CatalogUtils.java
static public String escapePathForURL(String path) {
        try {
            return new URI(null, null, path, null).toString();
        } catch (URISyntaxException e) {
            return path;
        }
    }
static public String escapePathForURL(String path) {
        try {
            return new URI(null, null, path, null).toString();
        } catch (URISyntaxException e) {
            return path;
        }
    }
Escape the characters necessary for a path to be valid for a URL