Bug 547691 - Exception when requesting location URI for deleted project

When requesting the location URI of a deleted project with
FileSystemResourceManager.locationURIFor(IResource), an exception is
thrown. This is due to FileStoreRoot.getManager(IPath) not finding the
project with IWorkspace.findMember(IPath), and assuming its a file.
Workspace.newResource(IPath, int) then attempts to create a file with
the specified path, but fails since that path has only 1 segment (the
projects name).

This change ensures correct handling for project paths in
FileStoreRoot.getManager(IPath) and also adds a test for the case. The
test expects no exceptions when calling
FileSystemResourceManager.locationURIFor(IResource) with a deleted
project.

Change-Id: Ib0aa11e0270fe472c8e20b2306293fcbecac9bb0
Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
4 files changed