Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » cannot convert from URI to URI
cannot convert from URI to URI [message #325794] Wed, 27 February 2008 11:31 Go to next message
Eclipse UserFriend
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 13:35 Go to previous message
Eclipse UserFriend
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
>
>
>
Previous Topic:key binding in editor does not work in eclipse 3.4
Next Topic:Using Plug-in properties API?
Goto Forum:
  


Current Time: Fri Aug 16 22:24:22 GMT 2024

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

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

Back to the top