Hi,
I'm trying to create a new file in an eclipse plugin. It's not necessarily a Java file, it can be an HTML file for example.
Right now I'm doing this:
IProject project = ... IFile file = project.getFile("/somepath/somefilename"); // such as file.exists() == false String contents = "Whatever"; InputStream source = new ByteArrayInputStream(contents.getBytes()); file.create(source, false, null);
The file gets created, but the problem is that it doesn't get recognized as any type; I can't open it in any internal editor. That's until I restart Eclipse (refresh or close then open the project doesn't help). After a restart, the file is perfectly usable and opens in the correct default editor for its type.
Is there any method I need to call to get the file outside of that "limbo" state?