Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Recoskie2009-10-23 19:06:21 +0000
committerChris Recoskie2009-10-23 19:06:21 +0000
commita6c428d08cf658210a69b6105b296afa32cad092 (patch)
tree3ea2f2ff9bfe2e9f435a8a968c02967ccf1d61eb
parent1fbe0630f7f0c2f03a4f0b495d4cf17f6ad66620 (diff)
downloadorg.eclipse.cdt-a6c428d08cf658210a69b6105b296afa32cad092.tar.gz
org.eclipse.cdt-a6c428d08cf658210a69b6105b296afa32cad092.tar.xz
org.eclipse.cdt-a6c428d08cf658210a69b6105b296afa32cad092.zip
further changes to IFileSystemUtility and friends
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IFilesystemUtility.java10
-rw-r--r--core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/FileSystemUtilityManager.java14
2 files changed, 23 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IFilesystemUtility.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IFilesystemUtility.java
index a405f4bb44a..1d8bc054d50 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IFilesystemUtility.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IFilesystemUtility.java
@@ -30,7 +30,7 @@ public interface IFilesystemUtility {
* In the future, it would be better if EFS had an API for this.
*
* @param locationURI
- * @return String representing the path, or null if there is an error or if there is no such physical file.
+ * @return String representing the path, or <code>null</code> if there is an error or if there is no such physical file.
*/
public String getPathFromURI(URI locationURI);
@@ -53,4 +53,12 @@ public interface IFilesystemUtility {
* @return URI
*/
public URI replacePathInURI(URI locationOnSameFilesystem, String path);
+
+ /**
+ * Gets the path for this file as it appears when it is mapped into the filesystem. For
+ * unmapped filesystems, this would return the same path as getPathFromURI(URI locationURI)
+ *
+ * @return String representing the path, or <code>null</code> on error.
+ */
+ public String getMappedPath(URI locationURI);
}
diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/FileSystemUtilityManager.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/FileSystemUtilityManager.java
index 33dd86a667b..6de31434c79 100644
--- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/FileSystemUtilityManager.java
+++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/FileSystemUtilityManager.java
@@ -151,5 +151,19 @@ public class FileSystemUtilityManager {
return utility.replacePathInURI(uri, path);
}
}
+
+ public String getMappedPath(URI uri) {
+ IFilesystemUtility utility = fSchemeToUtilityImplementerMap.get(uri.getScheme());
+
+ if(utility == null) {
+ // if there is no corresponding utility, then assume it's just the path field
+ return uri.getPath();
+
+ }
+
+ else {
+ return utility.getMappedPath(uri);
+ }
+ }
}

Back to the top