JDT: how to get the workspace from *.internal.compiler.Compiler.process() [message #218117] |
Tue, 26 June 2007 13:54  |
Eclipse User |
|
|
|
Originally posted by: g_karab.cs.concordia.ca
Hi guys,
I have posted the following under the jdt group but I got no reply so I
am asking here as well in the hope I will get some pointers.
I am wondering if there is an "easy" way to obtain the full path name of
the file containing the compilation unit being processed? The
CompilationUnitDeclaration.getFileName() returns a partial path name
relative to the workspace AFAIK. Another workaround to this will be to
be able to obtain the current workspace but I can't see how I can do this.
Of course I can use the Compiler.lookupEnvironment.nameEnvironment and
search for it. Is there any other way?
Any help/ideas is appreciated.
TIA,
George
|
|
|
|
Re: JDT: how to get the workspace from *.internal.compiler.Compiler.process() [message #218183 is a reply to message #218151] |
Tue, 26 June 2007 19:22  |
Eclipse User |
|
|
|
Originally posted by: g_karab.cs.concordia.ca
Thank you so much Stefan for pointing me to the ResourcesPlugin class.
Invoking
ResourcesPlugin.getWorkspace().getRoot().getRawLocation().to String();
gets me the workspace :).
Thanks again for the pointer!
George
Stefan Zugal wrote:
> Hi,
>
> what about ResourcesPlugin.getWorkspace() (from plugin
> org.eclipse.core.resources) and then search for your file - this should
> be possible, since you have the relative path.
> When you have the corresponding IFile, it should be no problem to get
> the full path (using some method from FileLocator).
>
> HTH,
> Stefan
>
> George Karabotsos schrieb:
>> Hi guys,
>>
>> I have posted the following under the jdt group but I got no reply so
>> I am asking here as well in the hope I will get some pointers.
>>
>> I am wondering if there is an "easy" way to obtain the full path name
>> of the file containing the compilation unit being processed? The
>> CompilationUnitDeclaration.getFileName() returns a partial path name
>> relative to the workspace AFAIK. Another workaround to this will be
>> to be able to obtain the current workspace but I can't see how I can
>> do this.
>>
>> Of course I can use the Compiler.lookupEnvironment.nameEnvironment and
>> search for it. Is there any other way?
>>
>> Any help/ideas is appreciated.
>>
>> TIA,
>>
>> George
|
|
|
Powered by
FUDForum. Page generated in 0.08677 seconds