.project
包含的示例
<linkedResources>
<link>
<name>node_lib</name>
<type>2</type>
<location>E:/Nodejs/node-v0.10.22/node-v0.10.22/lib</location>
</link>
</linkedResources>
如何以编程方式添加链接资源?
org.eclipse.core.resources.IProjectDescription
没有相关方法
所以这个Q提到getLinks()
(JavaDoc没有)Eclipse为链接资源添加IProject
标记
相关:以
编程方式从 Eclipse 中的项目中删除链接文件
更新:在两个答案的帮助下解决,因为它们带来了对 Eclipse 术语的理解(什么是什么)
代码
IFolder link = project.getFolder("Link");
IPath location = new Path("TEMP/folder");
if (workspace.validateLinkLocation(location).isOK()) {
link.createLink(location, IResource.NONE, null);
} else {
//invalid location, throw an exception or warn user
}