Creates the new
File in current container.
Fires following events:
ResourceChangedEvent when file has successfully created.
Method produces new
File.
The supplied argument
name should be a valid and pass validation within
NameUtils#checkFileName(String) (String)}.
Note. That files can not be created in workspace root (obtained by
AppContext#getWorkspaceRoot()). Creating folder in this container will be failed.
The file content may be a
null or empty.
Example of usage:
Container workspace = ... ;
workspace.newFile("name", "content").then(new Operation() {
public void apply(File newFile) throws OperationException {
//do something with new file
}
});
Fires
ResourceChangedEvent with the following
ResourceDelta: Delta kind:
ResourceDelta#ADDED. Created resource (instance of
File) provided by
ResourceDelta#getResource()