Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2005-03-17 15:16:12 +0000
committerDani Megert2005-03-17 15:16:12 +0000
commit4e0a0acfc9636dfe30e423f2e5409744d8622d47 (patch)
treea66f4ef77a174fdb061369e35e5cb9a67982c662 /org.eclipse.core.filebuffers.tests/src
parent2a4a549a36e8a5c3b7de15894485d445423191c8 (diff)
downloadeclipse.platform.text-4e0a0acfc9636dfe30e423f2e5409744d8622d47.tar.gz
eclipse.platform.text-4e0a0acfc9636dfe30e423f2e5409744d8622d47.tar.xz
eclipse.platform.text-4e0a0acfc9636dfe30e423f2e5409744d8622d47.zip
Added helper to add a file to a project
Diffstat (limited to 'org.eclipse.core.filebuffers.tests/src')
-rw-r--r--org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/ResourceHelper.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/ResourceHelper.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/ResourceHelper.java
index 409666957..1e202d5fe 100644
--- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/ResourceHelper.java
+++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/ResourceHelper.java
@@ -95,7 +95,14 @@ public class ResourceHelper {
}
public static IFile createFile(IFolder folder, String name, String contents) throws CoreException {
- IFile file= folder.getFile(name);
+ return createFile(folder.getFile(name), name, contents);
+ }
+
+ public static IFile createFile(IProject project, String name, String contents) throws CoreException {
+ return createFile(project.getFile(name), name, contents);
+ }
+
+ private static IFile createFile(IFile file, String name, String contents) throws CoreException {
if (contents == null)
contents= "";
InputStream inputStream= new StringBufferInputStream(contents);

Back to the top