IWorkspace workspace = ResourcesPlugin.getWorkspace(); IProject project = workspace.getRoot().getProject("MyProject"); project.create(null);
project.setDescription(new ProjectDescription());
IFile file = project.getFile("myfile.txt"); if (!file.exists()) { file.create(new ByteArrayInputStream(new byte[0]), true, null); }This code creates a new file named "myfile.txt" in the project and writes an empty byte array to it. Overall, the org.eclipse.core.resources IProject build is a useful package library for managing Eclipse projects programmatically.