/** * Changes this file to be a folder in the resource tree and returns the newly created folder. All * related properties are deleted. It is assumed that on disk the resource is already a * folder/directory so no action is taken to delete the disk contents. * * <p><b>This method is for the exclusive use of the local resource manager</b> */ public IFolder changeToFolder() throws CoreException { getPropertyManager().deleteProperties(this, IResource.DEPTH_ZERO); IFolder result = workspace.getRoot().getFolder(path); if (isLinked()) { IPath location = getRawLocation(); delete(IResource.NONE, null); result.createLink(location, IResource.ALLOW_MISSING_LOCAL, null); } else { workspace.deleteResource(this); workspace.createResource(result, false); } return result; }