Cannot access file from view [message #245978] |
Thu, 19 July 2007 04:32  |
Eclipse User |
|
|
|
Originally posted by: amit.hanchinamani.gmail.com
Hi all,
I am developing an eclipse plugin. I want to access a file located in my
workspace and I create an object of File to access it. The problem is I
can access the file from a normal java program, but when I try to access
the file from within my view class, it throws exception as file not found.
Is that I have to do something different for accessing a file from view
class..?
Thanks in advance
Cheers
Amit
|
|
|
Re: Cannot access file from view [message #245995 is a reply to message #245978] |
Thu, 19 July 2007 06:54  |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Amit,
This question isn't even related to JDT, so it's best post to the
newcomers or platform newsgroup for questions like this. And it would
be even better to provide sufficient detail for folks to know what you
are doing. It sounds likely to me that you aren't using an absolute
file path and hence you are relying on the value of the current working
directory to help find your file. Shouldn't you use the workspace APIs
to access files in the workspace? Or is this a file in your code that
needs to be loaded at runtime, in which case you should ensure that file
ends up in your jar and load it as a resource.
Amit wrote:
> Hi all,
>
> I am developing an eclipse plugin. I want to access a file located in
> my workspace and I create an object of File to access it. The problem
> is I can access the file from a normal java program, but when I try to
> access the file from within my view class, it throws exception as file
> not found.
> Is that I have to do something different for accessing a file from
> view class..?
> Thanks in advance
>
>
> Cheers
> Amit
>
|
|
|
Powered by
FUDForum. Page generated in 0.03196 seconds