- URL baseUrl = null, topUrl = null;
- try {
- // Try to parse base url if given
- String baseText = _baseUrlField.getText().trim();
- if (baseText.length() > 10) {
- baseUrl = new URL(baseText);
- }
- else if (baseText.length() > 0) {ok = false;}
- // Same again for top url if given
- String topText = _topUrlField.getText().trim();
- if (topText.length() > 10) {
- topUrl = new URL(topText);
- }
- else if (topText.length() > 0) {ok = false;}
- } catch (MalformedURLException e) {
- ok = false;
- }
+ String baseUrl = null, topUrl = null;
+ // Try to parse base url if given
+ String baseText = _baseUrlField.getText().trim();
+ baseUrl = MapSource.fixBaseUrl(baseText);
+ if (baseText.length() > 0 && baseUrl == null) {ok = false;}
+ // Same again for top url if given
+ String topText = _topUrlField.getText().trim();
+ topUrl = MapSource.fixBaseUrl(topText);
+ if (topText.length() > 0 && topUrl == null) {ok = false;}