resource still out of sync after refreshLocal [message #331261] |
Thu, 28 August 2008 16:16 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Anton Pussep![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=anton%40pussep.de) Messages: 2 Registered: July 2009 |
Junior Member |
|
|
Hi,
I am experiencing problems with the refreshLocal method. I call it right
after a file is modified using some java.io classes, but when I try to
open or delete this file afterwards, I get the message that the resource
is out of sync. However, if I refresh manually (F5), it works. Any idea
what might be wrong?
Here is the code (slightly modified), where modifyFilesInContainer
modifies the files, after that refreshLocal is called. I have no idea what
the problem could possibly be.
IContainer container = getWorkspace().getRoot().getFolder("test");
modifyFilesInContainer(container);
try {
container.refreshLocal(IResource.DEPTH_INFINITE, null);
} catch (CoreException e) {
// ...
}
Best,
Anton
|
|
|
|
|
Re: resource still out of sync after refreshLocal [message #331292 is a reply to message #331261] |
Fri, 29 August 2008 06:49 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Dani Megert![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=Daniel_Megert%40ch.ibm.com) Messages: 3802 Registered: July 2009 |
Senior Member |
|
|
Anton Pussep wrote:
> Hi,
>
> I am experiencing problems with the refreshLocal method. I call it
> right after a file is modified using some java.io classes, but when I
> try to open or delete this file afterwards, I get the message that the
> resource is out of sync. However, if I refresh manually (F5), it
> works. Any idea what might be wrong?
Are you sure the changes via java.io are flushed and the file no longer
locked when you call refreshLocal? Also, are you doing the refresh in
the UI thread or some other thread that might refresh after the UI
accesses the file?
Dani
>
> Here is the code (slightly modified), where modifyFilesInContainer
> modifies the files, after that refreshLocal is called. I have no idea
> what the problem could possibly be.
>
> IContainer container = getWorkspace().getRoot().getFolder("test");
> modifyFilesInContainer(container);
> try {
> container.refreshLocal(IResource.DEPTH_INFINITE, null);
> } catch (CoreException e) {
> // ...
> }
>
> Best,
> Anton
>
|
|
|
Powered by
FUDForum. Page generated in 0.03842 seconds