Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » ResourceException : Resource '/odyssey/runtime-New_configuration/TEST/messages.message' does not ex
ResourceException : Resource '/odyssey/runtime-New_configuration/TEST/messages.message' does not ex [message #320611] Tue, 25 September 2007 04:11 Go to next message
Eclipse UserFriend
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
Re: ResourceException : Resource '/odyssey/runtime-New_configuration/TEST/messages.message' does no [message #320623 is a reply to message #320611] Tue, 25 September 2007 07:12 Go to previous message
Eclipse UserFriend
Originally posted by: alexjaquet.gmail.com

Solved by modify getFullPath who get the fullpath and not the location
Previous Topic:Re: How to Get the TableItem in the Table Viewer
Next Topic:What's the best way of re-using editing components
Goto Forum:
  


Current Time: Tue Jul 22 21:34:21 EDT 2025

Powered by FUDForum. Page generated in 0.02878 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top