Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Testing linked resource for existence
Testing linked resource for existence [message #291405] Wed, 14 September 2005 22:50 Go to next message
Eclipse UserFriend
What is the correct/best way to test if a linked resource still points to
a local file that exists?

Checking for IFile.exists() just tells you if the linked resource is in
the repository, right?

Is there a better way than checking for
IFile.getLocation().toFile().exists()?

Thanks,

Ash
Re: Testing linked resource for existence [message #291492 is a reply to message #291405] Fri, 16 September 2005 14:33 Go to previous message
Eclipse UserFriend
Originally posted by: john.eclipsefaq.org

I would suggest:

resource.refreshLocal(IResource.DEPTH_INFINITE, null);
resource.exists();

By refreshing first, you can be sure that the workspace contents match
what is on disk. However, your code snippet will also work (assuming
getLocation() does not return null).
--

Ash Maurya wrote:
> What is the correct/best way to test if a linked resource still points
> to a local file that exists?
>
> Checking for IFile.exists() just tells you if the linked resource is in
> the repository, right?
> Is there a better way than checking for
> IFile.getLocation().toFile().exists()?
>
> Thanks,
>
> Ash
>
Previous Topic:How to acces to a file stored into the plugin project?
Next Topic:How to make image associate with your feature
Goto Forum:
  


Current Time: Thu Sep 25 14:32:15 EDT 2025

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

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

Back to the top