resource still out of sync after refreshLocal [message #331261] |
Thu, 28 August 2008 16:16  |
Eclipse User |
|
|
|
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 #331286 is a reply to message #331261] |
Thu, 28 August 2008 20:27   |
Eclipse User |
|
|
|
Anton Pussep wrote:
> IContainer container = getWorkspace().getRoot().getFolder("test");
> modifyFilesInContainer(container);
> try {
> container.refreshLocal(IResource.DEPTH_INFINITE, null);
> } catch (CoreException e) {
> // ...
> }
I know this is just sample code but I don't know how literal you're
being... any chance that refreshLocal is, in fact, throwing an exception
that is being ignored?
|
|
|
Re: resource still out of sync after refreshLocal [message #331288 is a reply to message #331286] |
Thu, 28 August 2008 23:33   |
Eclipse User |
|
|
|
> I know this is just sample code but I don't know how literal you're
> being... any chance that refreshLocal is, in fact, throwing an exception
> that is being ignored?
No, the catch block adds the exception to the Error-Log View, so I am
pretty sure that no exception is thrown.
|
|
|
Re: resource still out of sync after refreshLocal [message #331292 is a reply to message #331261] |
Fri, 29 August 2008 06:49  |
Eclipse User |
|
|
|
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.06629 seconds