Skip to content

Instantly share code, notes, and snippets.

@rgarat
Created October 24, 2012 15:48
Show Gist options
  • Save rgarat/3946873 to your computer and use it in GitHub Desktop.
Save rgarat/3946873 to your computer and use it in GitHub Desktop.
LinkDirInEclipse
IProject project = request.getProject();
IFolder link = project.getFolder("assets");
IPath location = new Path(assetsDir);
if (workspace.validateLinkLocation(link, location).isOK()) {
try {
link.createLink(location, IResource.NONE, null);
} catch (CoreException e) {
throw new RuntimeException(e);
}
} else {
// invalid location, throw an exception or warn user
System.out.println("LinkDir not valid");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment