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.director.app
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.director.app')
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/Application.java21
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/src_ant/org/eclipse/equinox/p2/director/app/ant/DirectorTask.java18
2 files changed, 19 insertions, 20 deletions
diff --git a/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/Application.java b/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/Application.java
index ae4bb44c6..56c641f0f 100644
--- a/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/Application.java
+++ b/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/Application.java
@@ -12,8 +12,8 @@
package org.eclipse.equinox.internal.p2.director.app;
import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
+import java.net.URI;
+import java.net.URISyntaxException;
import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.app.IApplication;
@@ -57,9 +57,9 @@ public class Application implements IApplication {
private Path destination;
- private URL[] artifactRepositoryLocations;
+ private URI[] artifactRepositoryLocations;
- private URL[] metadataRepositoryLocations;
+ private URI[] metadataRepositoryLocations;
private String root;
private Version version = null;
@@ -165,7 +165,6 @@ public class Application implements IApplication {
}
private void initializeRepositories(boolean throwException) throws CoreException {
-
if (artifactRepositoryLocations == null) {
if (throwException)
missingArgument("artifactRepository"); //$NON-NLS-1$
@@ -182,7 +181,7 @@ public class Application implements IApplication {
anyValid = true;
} catch (ProvisionException e) {
//one of the repositories did not load
- LogHelper.log(new Status(IStatus.ERROR, Activator.ID, artifactRepositoryLocations[i].getPath() + " failed to load", e)); //$NON-NLS-1$
+ LogHelper.log(new Status(IStatus.ERROR, Activator.ID, artifactRepositoryLocations[i].toString() + " failed to load", e)); //$NON-NLS-1$
}
}
if (throwException && !anyValid)
@@ -207,7 +206,7 @@ public class Application implements IApplication {
anyValid = true;
} catch (ProvisionException e) {
//one of the repositories did not load
- LogHelper.log(new Status(IStatus.ERROR, Activator.ID, metadataRepositoryLocations[i].getPath() + " failed to load", e)); //$NON-NLS-1$
+ LogHelper.log(new Status(IStatus.ERROR, Activator.ID, metadataRepositoryLocations[i].toString() + " failed to load", e)); //$NON-NLS-1$
}
}
if (throwException && !anyValid)
@@ -500,19 +499,19 @@ public class Application implements IApplication {
return engine.perform(profile, new DefaultPhaseSet(), result.getOperands(), new ProvisioningContext(), new NullProgressMonitor());
}
- private static URL[] getURLs(String spec) {
+ private static URI[] getURLs(String spec) {
if (spec == null)
return null;
String[] urlSpecs = getArrayFromString(spec, ","); //$NON-NLS-1$
ArrayList result = new ArrayList(urlSpecs.length);
for (int i = 0; i < urlSpecs.length; i++) {
try {
- result.add(new URL(urlSpecs[i]));
- } catch (MalformedURLException e) {
+ result.add(new URI(urlSpecs[i]));
+ } catch (URISyntaxException e) {
NLS.bind(Messages.Ignored_repo, urlSpecs[i]);
}
}
- return (URL[]) result.toArray(new URL[result.size()]);
+ return (URI[]) result.toArray(new URI[result.size()]);
}
/**
diff --git a/bundles/org.eclipse.equinox.p2.director.app/src_ant/org/eclipse/equinox/p2/director/app/ant/DirectorTask.java b/bundles/org.eclipse.equinox.p2.director.app/src_ant/org/eclipse/equinox/p2/director/app/ant/DirectorTask.java
index a13ed31bd..28d3b5fd3 100644
--- a/bundles/org.eclipse.equinox.p2.director.app/src_ant/org/eclipse/equinox/p2/director/app/ant/DirectorTask.java
+++ b/bundles/org.eclipse.equinox.p2.director.app/src_ant/org/eclipse/equinox/p2/director/app/ant/DirectorTask.java
@@ -11,8 +11,8 @@
package org.eclipse.equinox.p2.director.app.ant;
import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
+import java.net.URI;
+import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import org.apache.tools.ant.*;
@@ -30,7 +30,7 @@ public class DirectorTask extends Task {
boolean list;
String profile, flavor, os, ws, nl, arch, installIU, uninstallIU;
File destination, bundlePool;
- URL metadataRepository, artifactRepository;
+ URI metadataRepository, artifactRepository;
Version version;
/*
@@ -64,11 +64,11 @@ public class DirectorTask extends Task {
}
if (metadataRepository != null) {
result.add("-metadataRepository");
- result.add(metadataRepository.toExternalForm());
+ result.add(metadataRepository.toString());
}
if (artifactRepository != null) {
result.add("-artifactRepository");
- result.add(artifactRepository.toExternalForm());
+ result.add(artifactRepository.toString());
}
if (flavor != null) {
result.add("-flavor");
@@ -114,8 +114,8 @@ public class DirectorTask extends Task {
public void setArtifactRepository(String value) {
try {
- artifactRepository = new URL(value);
- } catch (MalformedURLException e) {
+ artifactRepository = new URI(value);
+ } catch (URISyntaxException e) {
log("Error setting the artifact repository.", e, Project.MSG_ERR);
}
}
@@ -142,8 +142,8 @@ public class DirectorTask extends Task {
public void setMetadataRepository(String value) {
try {
- metadataRepository = new URL(value);
- } catch (MalformedURLException e) {
+ metadataRepository = new URI(value);
+ } catch (URISyntaxException e) {
log("Error setting the metadata repository.", e, Project.MSG_ERR);
}
}

Back to the top