ResourceException : Resource '/odyssey/runtime-New_configuration/TEST/messages.message' does not ex [message #320611] |
Tue, 25 September 2007 04:11  |
Eclipse User |
|
|
|
Originally posted by: alexjaquet.gmail.com
Hi,
I encounter a little problem while I'm trying to load an existing resource.
I get my resource from a prefererences like this way :
Preferences preferences = getPreferences();
String filePath = preferences.get(TRANSLATION_REPOSITORY, null);
IProject p = (IProject) getActiveProject();
IPath path = getFullPath(p);
path = path.append(filePath);
IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
the file here is not null and the file path here is :
'/odyssey/runtime-New_configuration/TEST/messages.message'
Then I need to read datas from this file I do
private MessageRepository createMessageRepository(IFile file) {
ResourceSet rs = new ResourceSetImpl();
String filePath = file.getFullPath().toString();
URI uri = URI.createPlatformResourceURI(filePath, true);
Resource r = rs.getResource(uri, true);
return (MessageRepository) r.getContents().get(0);
}
and here at the following line Resource r = rs.getResource(uri, true); I
got my exception :
ResourceException : Resource
'/odyssey/runtime-New_configuration/TEST/messages.message' does not exist.
Any idea what I need to fix ?
Thanks
Regards,
Alexandre
|
|
|
|
Powered by
FUDForum. Page generated in 0.02878 seconds