[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform] Re: cannot convert from URI to URI

Aritz,

It sounds like you are trying to convert a java.net.URI to an org.eclipse.emf.common.util.URI. You can convert between them by converting either one to a string and constructing the other one from that string. Note that to access a workspace resource using an EMF resource you should be using URI.createPlatformURI(iFile.getFullPath().toString(), true) to create a URI of the form "platform:/resource/<project>/<path>/<file>...


Aritz wrote:
Hello everybody!!

I am having a problem with URI, and if somebody could help me, it would be greatful. First, I have to say that I am not sure if this question should be in this newsgroup; if it should be somewhere else, I am sorry.

I have get the current workspace, the root... and now, I want to get the URI, to use it later. But the problem is that I get next error: "Cannot convert URI to URI". Can anybody help me?

This is my code:

//getting the workspace

IWorkspace myWorkspace = org.eclipse.core.resources.ResourcesPlugin.getWorkspace();


//getting the root of the workspace

IWorkspaceRoot myWorkspaceRoot = myWorkspace.getRoot();



//getting and creating the path to store the diagram

URI myPath = myWorkspaceRoot.getLocation(); //URI is from org.eclipse.emf.common util

Thank you in advance, and sorry because of my poor English.

Aritz