Creating a file [message #52288] |
Wed, 28 May 2003 19:11 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: amiramb.us.ibm.com
Hi Guys,
I would like to know how to specify the location of a file that I have
created.
I have tried something like the following and some variations.
IProject project =
ResourcesPlugin.getWorkspace().getRoot().getProject("x");
IFile file = project.getFile("Test.java");
InputStream is = new ByteArrayInputStream( s.getBytes() )
file.create(is,false, monitor);
This creates me a file. The problem is that it creates the file under the
project's directory. I want to create a file inside another directory.
The targeted directory already exists and is under the project's directory.
Thanks,
Alfredo
|
|
|
Re: Creating a file [message #52508 is a reply to message #52288] |
Wed, 28 May 2003 20:41 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: richkulp.NOSPAM.us.ibm.com
Did you try instead:
> IFile file = project.getFile("thedirectoryIwant/Test.java");
--
Thanks, Rich Kulp
|
|
|
Powered by
FUDForum. Page generated in 0.03580 seconds