简体   繁体   English

java.io.FileNotFoundException(是一个目录)

[英]java.io.FileNotFoundException (Is a directory)

This is a piece of code, I am trying to read a project. 这是一段代码,我正在尝试阅读一个项目。 I am sure the project exists in the following path but I don't know why I am getting the following exception: 我确定该项目位于以下路径中,但我不知道为什么会收到以下异常:

org.eclipse.core.internal.resources.ResourceException()[567]: 
       java.io.FileNotFoundException "/home/XX" (Is a directory)

Code: 码:

 IProject project;

 String projectLocation = "/home/XX";

 IProjectDescription description;

 description = project.getWorkspace().loadProjectDescription(new Path(projectLocation));

 project.create(description, new NullProgressMonitor());

 project.open(new NullProgressMonitor());

 project.refreshLocal(IResource.DEPTH_INFINITE,new NullProgressMonitor());

If /home/XX is the directory containing the project, the actual project file is /home/XX/.project, and that is the path you should be using. 如果/ home / XX是包含项目的目录,则实际的项目文件是/home/XX/.project,这就是您应使用的路径。

According to the Eclipse documentation, loadProjectDescription requires the path in the local file system of an existing project description file", not the folder containing it. 根据Eclipse文档,loadProjectDescription需要现有项目描述文件在本地文件系统中的路径,而不是包含该路径的文件夹。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM