cannot convert from URI to URI [message #325794] |
Wed, 27 February 2008 06:31  |
Eclipse User |
|
|
|
Originally posted by: aritz.galdos.iese.fraunhofer.de
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
|
|
|
Re: cannot convert from URI to URI [message #325797 is a reply to message #325794] |
Wed, 27 February 2008 08:35  |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
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
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03235 seconds