Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/EntryAdvice.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java16
2 files changed, 8 insertions, 16 deletions
diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/EntryAdvice.java b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/EntryAdvice.java
index e455fb345..a494a8b1c 100644
--- a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/EntryAdvice.java
+++ b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/EntryAdvice.java
@@ -11,7 +11,7 @@
package org.eclipse.equinox.internal.provisional.p2.directorywatcher;
import java.io.File;
-import java.net.URL;
+import java.net.URI;
import java.util.Map;
import java.util.Properties;
import org.eclipse.equinox.internal.p2.update.Site;
@@ -47,15 +47,15 @@ public class EntryAdvice implements IFeatureAdvice, IBundleAdvice {
return artifactProps;
}
- void setProperties(File location, long timestamp, URL reference) {
+ void setProperties(File location, long timestamp, URI reference) {
setProperties(location, timestamp, reference, null);
}
- void setProperties(File location, long timestamp, URL reference, String linkFile) {
+ void setProperties(File location, long timestamp, URI reference, String linkFile) {
if (reference == null)
artifactProps.remove(RepositoryListener.ARTIFACT_REFERENCE);
else
- artifactProps.setProperty(RepositoryListener.ARTIFACT_REFERENCE, reference.toExternalForm());
+ artifactProps.setProperty(RepositoryListener.ARTIFACT_REFERENCE, reference.toString());
if (location.isDirectory())
artifactProps.setProperty(RepositoryListener.ARTIFACT_FOLDER, Boolean.TRUE.toString());
else
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 aac31ef40..0fe815f09 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
@@ -11,7 +11,6 @@
package org.eclipse.equinox.internal.provisional.p2.directorywatcher;
import java.io.File;
-import java.net.MalformedURLException;
import java.net.URI;
import java.util.*;
import org.eclipse.core.runtime.*;
@@ -155,11 +154,8 @@ public class RepositoryListener extends DirectoryChangeListener {
BundleDescription bundleDescription = BundlesAction.createBundleDescription(file);
if (bundleDescription == null)
return false;
- try {
- advice.setProperties(file, file.lastModified(), file.toURL());
- } catch (MalformedURLException e) {
- // should never happen
- }
+
+ advice.setProperties(file, file.lastModified(), file.toURI());
return publish(new BundlesAction(new BundleDescription[] {bundleDescription}), isAddition);
// TODO see bug 222370
// we only want to return the bundle IU so must exclude all fragment IUs
@@ -167,12 +163,8 @@ public class RepositoryListener extends DirectoryChangeListener {
}
private boolean processFeature(File file, boolean isAddition) {
- try {
- String link = (String) metadataRepository.getProperties().get(Site.PROP_LINK_FILE);
- advice.setProperties(file, file.lastModified(), file.toURL(), link);
- } catch (MalformedURLException e) {
- // should never happen
- }
+ String link = (String) metadataRepository.getProperties().get(Site.PROP_LINK_FILE);
+ advice.setProperties(file, file.lastModified(), file.toURI(), link);
return publish(new FeaturesAction(new File[] {file}), isAddition);
}

Back to the top