Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » caused by: java.io.IOException: The path '/page-ui/src/main/resources/page-designer.transformmodel'
caused by: java.io.IOException: The path '/page-ui/src/main/resources/page-designer.transformmodel' [message #410853] Wed, 11 July 2007 06:32 Go to next message
Alexandre Jaquet is currently offline Alexandre JaquetFriend
Messages: 38
Registered: July 2009
Member
Hi,

I'm trying to load a resource by using
createPlatformResourceURI("page-ui/src/main/resources/page-designer.transformmodel ",true);
and I'm getting the following exception :

caused by: java.io.IOException: The path
'/page-ui/src/main/resources/page-designer.transformmodel' is unmapped

here is my code snippet :

Hashtable result = new Hashtable();
ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put( "*",
new XMIResourceFactoryImpl());
URI fileURI2 =
URI.createPlatformResourceURI("page-ui/src/main/resources/page-designer.transformmodel ",true);
TransformModelPackage packageInstance = TransformModelPackage.eINSTANCE;

Any idea ?

Thanks
Re: caused by: java.io.IOException: The path '/page-ui/src/main/resources/page-designer.transformmod [message #410857 is a reply to message #410853] Wed, 11 July 2007 10:26 Go to previous messageGo to next message
Alexandre Jaquet is currently offline Alexandre JaquetFriend
Messages: 38
Registered: July 2009
Member
Founded by mapping the resource :

TransformModelPackage transformModelPackage =
TransformModelPackage.eINSTANCE;
ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put( "*",
new XMIResourceFactoryImpl());
URI mapping =
URI.createURI(" file://W:\\advisor\\OFS\\1.40.0\\ofs-designer\\ofs_plugins_e ditors\\page-ui");
EcorePlugin.getPlatformResourceMap().put("page-ui", mapping);

URI trURI =
URI.createPlatformResourceURI("page-ui/src/main/resources/page-designer.transformmodel ");
Re: caused by: java.io.IOException: The path '/page-ui/src/main/resources/page-designer.transformmod [message #410863 is a reply to message #410857] Wed, 11 July 2007 12:14 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 26283
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060204060604080802000002
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Alexandre,

Please keep in mind that "\" is just another character in a URI. It's
not a separator like it is when used in an OS-specific path. So you'd
be far better off calling

URI.createFileURI(" W:\\advisor\\OFS\\1.40.0\\ofs-designer\\ofs_plugins_editors\ \page-ui ")

I take it this avoids the problem you're seeing?


Alexandre Jaquet wrote:
> Founded by mapping the resource :
>
> TransformModelPackage transformModelPackage =
> TransformModelPackage.eINSTANCE;
> ResourceSet resourceSet = new ResourceSetImpl();
> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put( "*",
> new XMIResourceFactoryImpl());
> URI mapping =
> URI.createURI(" file://W:\\advisor\\OFS\\1.40.0\\ofs-designer\\ofs_plugins_e ditors\\page-ui");
>
> EcorePlugin.getPlatformResourceMap().put("page-ui", mapping);
>
> URI trURI =
> URI.createPlatformResourceURI("page-ui/src/main/resources/page-designer.transformmodel ");
>


--------------060204060604080802000002
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Alexandre,<br>
<br>
Please keep in mind that "\" is just another character in a URI.&nbsp; It's
not a separator like it is when used in an OS-specific path.&nbsp; So you'd
be far better off calling<br>
<blockquote>URI.createFileURI(" W:\\advisor\\OFS\\1.40.0\\ofs-designer\\ofs_plugins_editors\ \page-ui ")<br>
</blockquote>
I take it this avoids the problem you're seeing?<br>
<br>
<br>
Alexandre Jaquet wrote:
<blockquote cite="mid:f72b85$adb$1@build.eclipse.org" type="cite">Founded
by mapping the resource :
<br>
<br>
TransformModelPackage transformModelPackage =
TransformModelPackage.eINSTANCE;
<br>
ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put( "*",
new XMIResourceFactoryImpl());
<br>
URI mapping =
URI.createURI(<a class="moz-txt-link-rfc2396E" href=" file://W:\\advisor\\OFS\\1.40.0\\ofs-designer\\ofs_plugins_e ditors\\page-ui">" file://W:\\advisor\\OFS\\1.40.0\\ofs-designer\\ofs_plugins_e ditors\\page-ui"</a>);
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; EcorePlugin.getPlatformResourceMap().put("page-ui", mapping);
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; <br>
URI trURI =
URI.createPlatformResourceURI("page-ui/src/main/resources/page-designer.transformmodel ");
<br>
</blockquote>
<br>
</body>
</html>

--------------060204060604080802000002--
Previous Topic:Adding drag-and-drop support to tree view
Next Topic:Visualizing Cross-package References
Goto Forum:
  


Current Time: Fri Dec 19 10:19:05 GMT 2014

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

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