Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Arthorne2008-10-09 03:22:47 +0000
committerJohn Arthorne2008-10-09 03:22:47 +0000
commit773624727040c3a294359169f0f8d4aa22a7071d (patch)
treef51675a1f16deb759720dc7c3a4daa379935fdbd /bundles/org.eclipse.equinox.p2.ui.admin
parentdfe94e43cf371e39d46b07c9f0e6c6b28eeb000e (diff)
downloadrt.equinox.p2-773624727040c3a294359169f0f8d4aa22a7071d.tar.gz
rt.equinox.p2-773624727040c3a294359169f0f8d4aa22a7071d.tar.xz
rt.equinox.p2-773624727040c3a294359169f0f8d4aa22a7071d.zip
Bug 237776 Replace URL by URI
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.ui.admin')
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ArtifactRepositoriesView.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoriesView.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddArtifactRepositoryDialog.java20
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddMetadataRepositoryDialog.java6
4 files changed, 21 insertions, 21 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ArtifactRepositoriesView.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ArtifactRepositoriesView.java
index df183e6fe..9e1ae8a0f 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ArtifactRepositoriesView.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ArtifactRepositoriesView.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.admin;
-import java.net.URL;
+import java.net.URI;
import java.util.ArrayList;
import org.eclipse.equinox.internal.p2.ui.admin.dialogs.AddArtifactRepositoryDialog;
import org.eclipse.equinox.internal.p2.ui.admin.preferences.PreferenceConstants;
@@ -58,12 +58,12 @@ public class ArtifactRepositoriesView extends RepositoriesView {
}
protected ProvisioningOperation getRemoveOperation(Object[] elements) {
- ArrayList urls = new ArrayList();
+ ArrayList locations = new ArrayList();
for (int i = 0; i < elements.length; i++) {
if (elements[i] instanceof IRepositoryElement)
- urls.add(((IRepositoryElement) elements[i]).getLocation());
+ locations.add(((IRepositoryElement) elements[i]).getLocation());
}
- return new RemoveArtifactRepositoryOperation(ProvAdminUIMessages.ArtifactRepositoriesView_RemoveRepositoryOperationLabel, (URL[]) urls.toArray(new URL[urls.size()]));
+ return new RemoveArtifactRepositoryOperation(ProvAdminUIMessages.ArtifactRepositoriesView_RemoveRepositoryOperationLabel, (URI[]) locations.toArray(new URI[locations.size()]));
}
protected int getRepoFlags() {
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoriesView.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoriesView.java
index 7699c416c..bc29dbb36 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoriesView.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoriesView.java
@@ -12,7 +12,7 @@
package org.eclipse.equinox.internal.p2.ui.admin;
import java.lang.reflect.InvocationTargetException;
-import java.net.URL;
+import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -133,12 +133,12 @@ public class MetadataRepositoriesView extends RepositoriesView {
}
protected ProvisioningOperation getRemoveOperation(Object[] elements) {
- ArrayList urls = new ArrayList();
+ ArrayList locations = new ArrayList();
for (int i = 0; i < elements.length; i++) {
if (elements[i] instanceof IRepositoryElement)
- urls.add(((IRepositoryElement) elements[i]).getLocation());
+ locations.add(((IRepositoryElement) elements[i]).getLocation());
}
- return new RemoveMetadataRepositoryOperation(ProvAdminUIMessages.ArtifactRepositoriesView_RemoveRepositoryOperationLabel, (URL[]) urls.toArray(new URL[urls.size()]));
+ return new RemoveMetadataRepositoryOperation(ProvAdminUIMessages.ArtifactRepositoriesView_RemoveRepositoryOperationLabel, (URI[]) locations.toArray(new URI[locations.size()]));
}
protected void makeActions() {
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddArtifactRepositoryDialog.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddArtifactRepositoryDialog.java
index c3a37207f..44a7d7b45 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddArtifactRepositoryDialog.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddArtifactRepositoryDialog.java
@@ -10,14 +10,14 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.admin.dialogs;
-import java.net.URL;
+import java.net.URI;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.ui.admin.ProvAdminUIActivator;
import org.eclipse.equinox.internal.p2.ui.admin.ProvAdminUIMessages;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.ui.dialogs.AddRepositoryDialog;
import org.eclipse.equinox.internal.provisional.p2.ui.operations.*;
-import org.eclipse.equinox.internal.provisional.p2.ui.policy.URLValidator;
+import org.eclipse.equinox.internal.provisional.p2.ui.policy.RepositoryLocationValidator;
import org.eclipse.swt.widgets.Shell;
/**
@@ -32,22 +32,22 @@ public class AddArtifactRepositoryDialog extends AddRepositoryDialog {
super(parentShell, repoFlags);
}
- protected ProvisioningOperation getOperation(URL url) {
- return new AddArtifactRepositoryOperation(ProvAdminUIMessages.AddArtifactRepositoryDialog_OperationLabel, url);
+ protected ProvisioningOperation getOperation(URI location) {
+ return new AddArtifactRepositoryOperation(ProvAdminUIMessages.AddArtifactRepositoryDialog_OperationLabel, location);
}
- protected URLValidator createURLValidator() {
- return new URLValidator() {
- public IStatus validateRepositoryURL(URL location, boolean contactRepositories, IProgressMonitor monitor) {
+ protected RepositoryLocationValidator createURLValidator() {
+ return new RepositoryLocationValidator() {
+ public IStatus validateRepositoryLocation(URI location, boolean contactRepositories, IProgressMonitor monitor) {
IStatus duplicateStatus = Status.OK_STATUS;
- URL[] knownRepositories;
+ URI[] knownRepositories;
try {
knownRepositories = ProvisioningUtil.getArtifactRepositories(repoFlag);
} catch (ProvisionException e) {
- knownRepositories = new URL[0];
+ knownRepositories = new URI[0];
}
for (int i = 0; i < knownRepositories.length; i++) {
- if (knownRepositories[i].toExternalForm().equalsIgnoreCase(location.toExternalForm())) {
+ if (knownRepositories[i].equals(location)) {
duplicateStatus = new Status(IStatus.ERROR, ProvAdminUIActivator.PLUGIN_ID, LOCAL_VALIDATION_ERROR, ProvAdminUIMessages.AddArtifactRepositoryDialog_DuplicateURL, null);
break;
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddMetadataRepositoryDialog.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddMetadataRepositoryDialog.java
index d852dc054..7dc22d60c 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddMetadataRepositoryDialog.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddMetadataRepositoryDialog.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.admin.dialogs;
-import java.net.URL;
+import java.net.URI;
import org.eclipse.equinox.internal.p2.ui.admin.ProvAdminUIMessages;
import org.eclipse.equinox.internal.provisional.p2.ui.dialogs.AddRepositoryDialog;
import org.eclipse.equinox.internal.provisional.p2.ui.operations.AddMetadataRepositoryOperation;
@@ -29,7 +29,7 @@ public class AddMetadataRepositoryDialog extends AddRepositoryDialog {
super(parentShell, repoFlags);
}
- protected ProvisioningOperation getOperation(URL url) {
- return new AddMetadataRepositoryOperation(ProvAdminUIMessages.AddMetadataRepositoryDialog_OperationLabel, url);
+ protected ProvisioningOperation getOperation(URI location) {
+ return new AddMetadataRepositoryOperation(ProvAdminUIMessages.AddMetadataRepositoryDialog_OperationLabel, location);
}
}

Back to the top