Summary: | [Linked Resources] Need a way to determine location of a deleted linked resource | ||
---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Walter Brunauer <walter.brunauer> |
Component: | Resources | Assignee: | Platform-Resources-Inbox <platform-resources-inbox> |
Status: | REOPENED --- | QA Contact: | |
Severity: | enhancement | ||
Priority: | P4 | CC: | john.arthorne, Szymon.Brandys |
Version: | 3.3 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Walter Brunauer
2007-11-08 08:02:54 EST
I can reproduce it on 3.4 M3 as well. The issue here is that the delta is created when the store for the linked file doesn't exist. That's why FileSystemResourceManager returns such a strange location for the resource. Actually it's behaving as the API states. If you look at the javadoc for IResource#getLocation, you can read * If this resource is a linked resource under a project that is open, this * method returns the resolved path to the linked resource's local contents. * This value will be null in the case where the location is relative to an * undefined workspace path variable. * If this resource is a file or folder under a project that exists, or a * linked resource under a closed project, this method returns a (non- * <code>null</code>) path computed from the location of the project's local * content area and the project- relative path of the file or folder. This is * true regardless of whether the file or folders exists, or whether the project * is open or closed. You are trying to get the location for the file that is already deleted. It results in a non-null path computed from the location of the project's local content area and the project-relative path of the file or folder. That's a matter of interpretation, I guess:-) What option do I have to get the real location of a linked resource, if it is going to be deleted? Is there any notification before the resource actually gets deleted? I can't see such an event in Resources. The only one that sounds interesting is PRE_DELETE, but it works only for projects. Maybe having PRE_RESOURCE_DELETE would help. Changing summary to reflect the real issue. Others have done this by listening to resource change events as resources are created, and maintaining their own table of linked resource locations. It would be useful if we could provide the old location of a linked resource in a POST_CHANGE delta. I am no longer involved in Platform Core development. |