X-Git-Url: https://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=src%2Ftim%2Fprune%2Fgui%2Fmap%2FMapSource.java;h=aa7127dee7020a70c9adb42f3a077e99075b6b8b;hp=c4e294665e128def7d1fcbfb048cb516624d5d00;hb=HEAD;hpb=1db53356139320890a8d10e982865a1899e11b81 diff --git a/src/tim/prune/gui/map/MapSource.java b/src/tim/prune/gui/map/MapSource.java index c4e2946..aa7127d 100644 --- a/src/tim/prune/gui/map/MapSource.java +++ b/src/tim/prune/gui/map/MapSource.java @@ -2,8 +2,7 @@ package tim.prune.gui.map; import java.net.MalformedURLException; import java.net.URL; -import java.util.regex.Matcher; -import java.util.regex.Pattern; + /** * Class to represent any map source, whether an OsmMapSource @@ -16,9 +15,6 @@ public abstract class MapSource /** File extensions */ protected String[] _extensions = null; - /** Regular expression for catching server wildcards */ - protected static final Pattern WILD_PATTERN = Pattern.compile("^(.*)\\[(.*)\\](.*)$"); - /** * @return the number of layers used in this source @@ -120,32 +116,6 @@ public abstract class MapSource return urlstr; } - /** - * Fix the site name by stripping off protocol and www. - * This is used to create the file path for disk caching - * @param inUrl url to strip - * @return stripped url - */ - protected static String fixSiteName(String inUrl) - { - if (inUrl == null || inUrl.equals("")) {return null;} - String url = inUrl.toLowerCase(); - int idx = url.indexOf("://"); - if (idx >= 0) {url = url.substring(idx + 3);} - if (url.startsWith("www.")) {url = url.substring(4);} - // Strip out any "[.*]" as well - if (url.indexOf('[') >= 0) - { - Matcher matcher = WILD_PATTERN.matcher(url); - if (matcher.matches()) { - url = matcher.group(1) + matcher.group(3); - if (url.length() > 1 && url.charAt(0) == '.') { - url = url.substring(1); - } - } - } - return url; - } /** * @return string which can be written to the Config