resource still out of sync after refreshLocal [message #331261] |
Thu, 28 August 2008 16:16 |
Anton Pussep 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 |
Dani Megert 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.04588 seconds