get file location using IFile and IProject [message #665103] |
Wed, 13 April 2011 05:30  |
Eclipse User |
|
|
|
I'm trying to use IFile to get the location in file system at several places in my plugin project.
iFile.getLocation().toFile().getAbsolutePath();
at most of the places(mostly in editors) it returns me the correct path. but in the activator class, i'm getting strange result using the same.
e.g. i've a file at
D:\eclipse-SDK-helios\runtime-EclipseApplication\testIde\Web Content\forms\Form0.form
in my editor when i use IFile, i get the path correctly.
D:\eclipse-SDK-helios\runtime-EclipseApplication\testIde\WebContent\forms\Form0.form
In my activator class, I'm adding a resource change listener to the workspace, there if i try to use IFile to get the file path, i get the following ---
D:\eclipse-SDK-helios\runtime-EclipseApplication\testIde\testIde\WebContent\forms\Form0.form
here extra "textIde" gets added to the file path.
and if i try IProject.getFile().getLocation(), i get the following
D:\eclipse-SDK-helios\runtime-EclipseApplication\testIde\Form0.form
here the "WebContent/forms" folder is missing in the path
"testIde" is my test project in the runtime application.
Can anyone explain me this behaviour! or is it a bug?
thanks,
|
|
|
|
Powered by
FUDForum. Page generated in 0.03007 seconds