[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.platform] Re: File Path API
|
Maybe this will give you some hints as to which API to look into:
IProject project =
ResourcesPlugin.getWorkspace().getRoot().getProject(best_project_match);
IPath as_specific_as_possible = source_path;
if (project.exists()) {
iseg++; // skip project name
IPath resourcePath = source_path.removeFirstSegments(iseg);
IResource resource = project.findMember(resourcePath);
as_specific_as_possible = resource.getLocation();
if (as_specific_as_possible == null) {
as_specific_as_possible = path; // someone lied
}
} // else not in workspace
If you really want a URL, then try something like
path.toFile().toURI().toURL();
Praveen wrote:
Hi,
I am writing a plugin and need to access a file within one of the folder.
I tried using URL u=this.getClass().getResource("/Profile/Profile.uml2");
But this returns a path of the eclipse installation. Is there any other
API which can return the path of the file?
Thanks Praveen.