Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Using IFile on a file outside of project folders
Using IFile on a file outside of project folders [message #242663] Wed, 19 May 2004 21:07 Go to next message
Eclipse UserFriend
Originally posted by: mafulton.us.ibm.com

Hey All,

My problem basically is opening an external file lying outside the eclipse
workspace from code inside eclipse. Since the actual "open external file"
functionality isn't the cleanest it could be(does not smoothly open
complex files such as Word Documents with external editors associated with
it), I am trying to go about this myself.

I have made a copy of the file inside the metadata folder that lies within
my workspace root. The problem is that the only way that the IFile can be
opened by an editor (internal or external) by eclipse is if the IFile
location lies within a project folder that is located in the workspace(not
within the metadata folder or the workspace root). And for the most part
you are not able to create an IFile object unless the path lies within
those project folders as well.

So I guess what I'm looking for is any ideas on how to create an IFile
from a file that is outside a project folder. Also if there are other
solutions that don't involve copying the file into the workspace or
anything I have said here then those are welcome as well.

Thanks.
Re: Using IFile on a file outside of project folders [message #242858 is a reply to message #242663] Thu, 20 May 2004 17:20 Go to previous message
Marcos López is currently offline Marcos LópezFriend
Messages: 75
Registered: July 2009
Member
I think that you can create a IFile linked to that external file, and then
open it.

Mike Fulton wrote:

> Hey All,

> My problem basically is opening an external file lying outside the eclipse
> workspace from code inside eclipse. Since the actual "open external file"
> functionality isn't the cleanest it could be(does not smoothly open
> complex files such as Word Documents with external editors associated with
> it), I am trying to go about this myself.

> I have made a copy of the file inside the metadata folder that lies within
> my workspace root. The problem is that the only way that the IFile can be
> opened by an editor (internal or external) by eclipse is if the IFile
> location lies within a project folder that is located in the workspace(not
> within the metadata folder or the workspace root). And for the most part
> you are not able to create an IFile object unless the path lies within
> those project folders as well.

> So I guess what I'm looking for is any ideas on how to create an IFile
> from a file that is outside a project folder. Also if there are other
> solutions that don't involve copying the file into the workspace or
> anything I have said here then those are welcome as well.

> Thanks.
Previous Topic:Finding Java Problems based on their ID
Next Topic:plugin for tiles
Goto Forum:
  


Current Time: Thu Jan 02 22:28:17 GMT 2025

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

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

Back to the top