| Author |
How to modify a file in an Eclipse plugin?
|
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11945
|
|
I decided to write a plugin for Eclipse and the functionality requires modifying an existing file (an instance of org.eclipse.core.resources.IFile), which I'm having trouble with. More accurately, I don't have a clue about how such a task should be done. IFile defines a few methods for reading from, appending to, and deleting the file. Is it ok to first delete(...) and then append(...) an IFile reference? Hyperlinks are also appreciated as I've found the official eclipse.org articles to be very superficial in nature. Thanks.
|
Author of Test Driven (Manning Publications, 2007) [Blog] [HowToAskQuestionsOnJavaRanch]
|
 |
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11945
|
|
|
Ok. I apparently had missed IFile#setContents(...), which sounds like the right thing to do/call.
|
 |
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11945
|
|
Yep, it works. Forget that I asked
|
 |
 |
|
|
subject: How to modify a file in an Eclipse plugin?
|
|
|