Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Kaegi2008-10-10 16:28:47 -0400
committerSimon Kaegi2008-10-10 16:28:47 -0400
commit69d43fcde6a7c26650f1393887b89aba72c85a2a (patch)
tree85b5d6b17b13d053d20a6e44c00ef48b5e11abda /bundles/org.eclipse.equinox.p2.directorywatcher
parent78b8217cbc6de8a29d167ffc6268ab5db14d9d41 (diff)
downloadrt.equinox.p2-69d43fcde6a7c26650f1393887b89aba72c85a2a.tar.gz
rt.equinox.p2-69d43fcde6a7c26650f1393887b89aba72c85a2a.tar.xz
rt.equinox.p2-69d43fcde6a7c26650f1393887b89aba72c85a2a.zip
Bug 250460 DirectoryWatcher should use URI based artifact referencesv20081010b
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/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