From acf380694a1c664c6b6b3815192a327ba21264dd Mon Sep 17 00:00:00 2001 From: Kai Maetzel Date: Fri, 17 Oct 2003 09:18:51 +0000 Subject: *** empty log message *** --- .../org/eclipse/core/filebuffers/FileBuffers.java | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'org.eclipse.core.filebuffers') 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 6f73ded95e0..99752828a0a 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. + *

+ * The location is either a full path of a workspace resource or an + * absolute path in the local file system. + *

+ * + * @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(); + } } -- cgit v1.2.3