Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Creating a file
Creating a file [message #52288] Wed, 28 May 2003 19:11 Go to next message
Eclipse UserFriend
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
Eclipse UserFriend
Originally posted by: richkulp.NOSPAM.us.ibm.com

Did you try instead:

> IFile file = project.getFile("thedirectoryIwant/Test.java");

--
Thanks, Rich Kulp

Previous Topic:How to set up extssh CVS access?
Next Topic:Trouble starting on Solaris (java.lang.ExceptionInInitializerError_
Goto Forum:
  


Current Time: Thu Jul 18 19:21:34 GMT 2024

Powered by FUDForum. Page generated in 0.03431 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top