Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Muskalla2012-05-08 10:21:06 -0400
committerSteffen Pingel2012-05-08 10:21:06 -0400
commitaa9a8b34ef6bc4246547e0c59679cc196b8a4a8b (patch)
tree08cd8d7a0f52a811fdcf683351998b5b40bb9094 /org.eclipse.mylyn.tasks.ui
parent60794da2e6020530526debe41ebfbd184fb85580 (diff)
downloadorg.eclipse.mylyn.tasks-aa9a8b34ef6bc4246547e0c59679cc196b8a4a8b.tar.gz
org.eclipse.mylyn.tasks-aa9a8b34ef6bc4246547e0c59679cc196b8a4a8b.tar.xz
org.eclipse.mylyn.tasks-aa9a8b34ef6bc4246547e0c59679cc196b8a4a8b.zip
NEW - bug 376939: provide default impl for isValidUrl in settings page
https://bugs.eclipse.org/bugs/show_bug.cgi?id=376939 Change-Id: Iabf75ddfc19781b759425420206a2f924aae93c7
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java
index 76f9b3ae9..6003abedb 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java
@@ -20,6 +20,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import org.apache.commons.httpclient.URI;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -1317,7 +1318,17 @@ public abstract class AbstractRepositorySettingsPage extends AbstractTaskReposit
/**
* @since 2.0
*/
- protected abstract boolean isValidUrl(String url);
+ protected boolean isValidUrl(String url) {
+ if (url.startsWith(URL_PREFIX_HTTPS) || url.startsWith(URL_PREFIX_HTTP)) {
+ try {
+ new URI(url, true, "UTF-8"); //$NON-NLS-1$
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+ return false;
+ }
private void updateHyperlinks() {
if (getRepositoryUrl() != null && getRepositoryUrl().length() > 0) {

Back to the top