Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-08-19 15:30:57 +0000
committerMichael Valenta2003-08-19 15:30:57 +0000
commit713eea079e2632a4ae92efb6b10c9eff10003f6f (patch)
tree8751255d1957bf8e3eb8f85d68138aaf860df7db /bundles/org.eclipse.team.core
parent5ab9f57711a0c566b20958cc2483fab12dc295ed (diff)
downloadeclipse.platform.team-713eea079e2632a4ae92efb6b10c9eff10003f6f.tar.gz
eclipse.platform.team-713eea079e2632a4ae92efb6b10c9eff10003f6f.tar.xz
eclipse.platform.team-713eea079e2632a4ae92efb6b10c9eff10003f6f.zip
Added support for file contents caching
Diffstat (limited to 'bundles/org.eclipse.team.core')
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ComparisonCriteria.java2
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ContentComparisonCriteria.java11
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/sync/RemoteContentsCache.java13
3 files changed, 24 insertions, 2 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ComparisonCriteria.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ComparisonCriteria.java
index aacc2a679..f004cb1c7 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ComparisonCriteria.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ComparisonCriteria.java
@@ -84,4 +84,6 @@ abstract public class ComparisonCriteria {
}
return false;
}
+
+ public abstract boolean usesFileContents();
}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ContentComparisonCriteria.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ContentComparisonCriteria.java
index 2ffa825b5..f5b4ac8ec 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ContentComparisonCriteria.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ContentComparisonCriteria.java
@@ -32,8 +32,8 @@ public class ContentComparisonCriteria extends ComparisonCriteria {
private boolean ignoreWhitespace = false;
- final public static String ID_IGNORE_WS = "org.eclipse.team.comparisoncriteria.content.ignore";
- final public static String ID_DONTIGNORE_WS = "org.eclipse.team.comparisoncriteria.content";
+ final public static String ID_IGNORE_WS = "org.eclipse.team.comparisoncriteria.content.ignore"; //$NON-NLS-1$
+ final public static String ID_DONTIGNORE_WS = "org.eclipse.team.comparisoncriteria.content"; //$NON-NLS-1$
public String getName() {
return "Comparing content" + (ignoreWhitespace ? " ignore whitespace": "");
@@ -163,4 +163,11 @@ public class ContentComparisonCriteria extends ComparisonCriteria {
throw TeamException.asTeamException(e);
}
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.core.subscribers.ComparisonCriteria#usesFileContents()
+ */
+ public boolean usesFileContents() {
+ return true;
+ }
}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/sync/RemoteContentsCache.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/sync/RemoteContentsCache.java
index 50952ef8e..98ee48d75 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/sync/RemoteContentsCache.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/sync/RemoteContentsCache.java
@@ -236,6 +236,19 @@ public class RemoteContentsCache {
}
/**
+ * Return whether the cache contains an entry for the given id. Register a hit if it does.
+ * @param id the id of the cache entry
+ * @return true if there are contents cached for the id
+ */
+ public boolean hasContents(String id) {
+ boolean contains = cacheFileNames.containsKey(id);
+ if (contains) {
+ registerHit(id);
+ }
+ return contains;
+ }
+
+ /**
* Purge the cache entry for the given id.
* @param id
*/

Back to the top