Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Arthorne2008-10-08 23:22:47 -0400
committerJohn Arthorne2008-10-08 23:22:47 -0400
commit773624727040c3a294359169f0f8d4aa22a7071d (patch)
treef51675a1f16deb759720dc7c3a4daa379935fdbd /bundles/org.eclipse.equinox.p2.directorywatcher
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.directorywatcher')
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/Activator.java11
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java12
3 files changed, 11 insertions, 16 deletions
diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/Activator.java b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/Activator.java
index 63f3ad864..54c196c30 100644
--- a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/Activator.java
+++ b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/Activator.java
@@ -12,8 +12,7 @@
package org.eclipse.equinox.internal.provisional.p2.directorywatcher;
import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
+import java.net.URI;
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager;
import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager;
@@ -48,17 +47,13 @@ public class Activator implements BundleActivator {
return (IMetadataRepositoryManager) ServiceHelper.getService(context, IMetadataRepositoryManager.class.getName());
}
- public static URL getDefaultRepositoryLocation(Object object, String repositoryName) {
+ public static URI getDefaultRepositoryLocation(Object object, String repositoryName) {
PackageAdmin packageAdmin = (PackageAdmin) ServiceHelper.getService(context, PackageAdmin.class.getName());
Bundle bundle = packageAdmin.getBundle(object.getClass());
BundleContext context = bundle.getBundleContext();
File base = context.getDataFile(""); //$NON-NLS-1$
File result = new File(base, "listener_" + repositoryName.hashCode()); //$NON-NLS-1$
result.mkdirs();
- try {
- return result.toURL();
- } catch (MalformedURLException e) {
- return null;
- }
+ return result.toURI();
}
}
diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java
index e08d5259a..8abed2915 100644
--- a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java
@@ -11,7 +11,7 @@ package org.eclipse.equinox.internal.provisional.p2.directorywatcher;
import java.io.File;
import java.io.OutputStream;
-import java.net.URL;
+import java.net.URI;
import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*;
@@ -172,7 +172,7 @@ public class CachingArtifactRepository implements IArtifactRepository, IFileArti
return innerRepo.getDescription();
}
- public URL getLocation() {
+ public URI getLocation() {
return innerRepo.getLocation();
}
diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java
index 807c8527d..aac31ef40 100644
--- a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java
+++ b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java
@@ -12,7 +12,7 @@ package org.eclipse.equinox.internal.provisional.p2.directorywatcher;
import java.io.File;
import java.net.MalformedURLException;
-import java.net.URL;
+import java.net.URI;
import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
@@ -57,8 +57,8 @@ public class RepositoryListener extends DirectoryChangeListener {
* @param hidden <code>true</code> if the repository should be hidden, <code>false</code> if not.
*/
public RepositoryListener(String repositoryName, boolean hidden) {
- URL location = Activator.getDefaultRepositoryLocation(this, repositoryName);
- metadataRepository = initiailzeMetadataRepository(repositoryName, location, hidden);
+ URI location = Activator.getDefaultRepositoryLocation(this, repositoryName);
+ metadataRepository = initializeMetadataRepository(repositoryName, location, hidden);
artifactRepository = initializeArtifactRepository(repositoryName, location, hidden);
initializePublisher();
}
@@ -77,7 +77,7 @@ public class RepositoryListener extends DirectoryChangeListener {
info.setArtifactOptions(IPublisherInfo.A_INDEX);
}
- protected CachingArtifactRepository initializeArtifactRepository(String repositoryName, URL repositoryLocation, boolean hidden) {
+ protected CachingArtifactRepository initializeArtifactRepository(String repositoryName, URI repositoryLocation, boolean hidden) {
IArtifactRepositoryManager manager = Activator.getArtifactRepositoryManager();
if (manager == null)
throw new IllegalStateException(Messages.artifact_repo_manager_not_registered);
@@ -103,7 +103,7 @@ public class RepositoryListener extends DirectoryChangeListener {
}
}
- protected IMetadataRepository initiailzeMetadataRepository(String repositoryName, URL repositoryLocation, boolean hidden) {
+ protected IMetadataRepository initializeMetadataRepository(String repositoryName, URI repositoryLocation, boolean hidden) {
IMetadataRepositoryManager manager = Activator.getMetadataRepositoryManager();
if (manager == null)
throw new IllegalStateException(Messages.metadata_repo_manager_not_registered);
@@ -156,7 +156,7 @@ public class RepositoryListener extends DirectoryChangeListener {
if (bundleDescription == null)
return false;
try {
- advice.setProperties(file, file.lastModified(), file.toURL(), null);
+ advice.setProperties(file, file.lastModified(), file.toURL());
} catch (MalformedURLException e) {
// should never happen
}

Back to the top