由一个文件夹的系统绝对路径,判断这个文件夹是否在workspace中。
String path= "C:\runtime-myproduct\project1";
IPath folderPath = new Path(path);
IContainer container = ResourcesPlugin.getWorkspace().getRoot().getContainerForLocation(folderPath);
if(container != null){
//means it's in the workspace
}
判断文件可以用
ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(IPath location)