Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Maetzel2003-10-17 09:18:51 +0000
committerKai Maetzel2003-10-17 09:18:51 +0000
commitacf380694a1c664c6b6b3815192a327ba21264dd (patch)
tree38ed7ed005ecf3f325acfa85288c3535695a80cf /org.eclipse.core.filebuffers
parenteaf219352f0f928c33d6493a9a3afb965a1e882d (diff)
downloadeclipse.platform.text-acf380694a1c664c6b6b3815192a327ba21264dd.tar.gz
eclipse.platform.text-acf380694a1c664c6b6b3815192a327ba21264dd.tar.xz
eclipse.platform.text-acf380694a1c664c6b6b3815192a327ba21264dd.zip
*** empty log message ***
Diffstat (limited to 'org.eclipse.core.filebuffers')
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/FileBuffers.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/FileBuffers.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/FileBuffers.java
index 6f73ded95..99752828a 100644
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/FileBuffers.java
+++ b/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/FileBuffers.java
@@ -10,6 +10,8 @@ Contributors:
**********************************************************************/
package org.eclipse.core.filebuffers;
+import java.io.File;
+
import org.eclipse.core.internal.filebuffers.FileBuffersPlugin;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IWorkspaceRoot;
@@ -72,4 +74,27 @@ public final class FileBuffers {
return fileLocation.makeAbsolute();
}
+
+ /**
+ * Returns the file in the local file system for the given location.
+ * <p>
+ * The location is either a full path of a workspace resource or an
+ * absolute path in the local file system.
+ * </p>
+ *
+ * @param location
+ * @return
+ */
+ public static File getSystemFileAtLocation(IPath location) {
+ if (location == null)
+ return null;
+
+ IFile file= getWorkspaceFileAtLocation(location);
+ if (file != null) {
+ IPath path= file.getLocation();
+ return path.toFile();
+ }
+
+ return location.toFile();
+ }
}

Back to the top