Question:
How to load content from an IFile in eclipse plugin project, and did not cause out of sync problem
Answer:
See IFile.getContents(), setContents() and create() methods.
Use getContents to read file into memory, modify it, then use setContents to write it out. That will keep your workspace in sync. If you try to convert to File and use standard Java file I/O, your workspace will be out of sync (requiring refresh) and you will be completely incompatible with other file storage systems used by Eclipse
Reference: