IPath folders = path.removeLastSegments(1).removeFirstSegments(1);
IPath checkPath = Path.ROOT;
int segmentCount = folders.segmentCount();
for(int i = 0; i < segmentCount; i++) {
checkPath = checkPath.addTrailingSeparator().append(folders.segment(i));
IFolder folder = project.getFolder(checkPath);
if(!folder.exists())
folder.create(true, true, null);
}
linkFile.createLink(uri, IResource.ALLOW_MISSING_LOCAL, null);