Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Cannot access file from view
Cannot access file from view [message #245978] Thu, 19 July 2007 04:32 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
>
Previous Topic:howto process properties/methods/annotations
Next Topic:eclipse and cvs ignore
Goto Forum:
  


Current Time: Wed May 28 18:21:13 EDT 2025

Powered by FUDForum. Page generated in 0.03196 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top