|
Re: [EMF] [message #946723 is a reply to message #946667] |
Tue, 16 October 2012 12:46 |
|
hi, Appasamy,
What does "not working" mean? Do you get an exception? If so, what
exception and with what message? Do you get a resource and it just has
no contents? Is this in an Eclipse context where you can see
exceptions logged in the workspace log? There are so many reasons why
this resource might not load as you would expect ...
Cheers,
Christian
On 2012-10-16 11:35:47 +0000, Appasamy Thirugnana said:
> Hi Everyone,
>
> I need to load a ecore file from my classpath
>
> ResourceSet resourceSet = new ResourceSetImpl();
>
>
> resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(
> "*", new EcoreResourceFactoryImpl() );
>
> final String[] ecores = new String[] {
> "classpath:models//library.ecore" };
>
> for( String ecore : ecores ) {
> final Resource res = resourceSet.getResource(
> URI.createFileURI(ecore ), true );}...
>
> But it is not working.
>
> Can somebody tell me the correct way?
>
> Thanks,
> Appasamy
|
|
|
|
Re: [EMF] [message #946732 is a reply to message #946723] |
Tue, 16 October 2012 12:54 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi
classpath URIs are an innovation introduced by MWE; they are unlikely to
work in EMF without following the appropriate MWE initialization orocedures.
Regards
Ed Willink
On 16/10/2012 13:46, Christian W. Damus wrote:
> hi, Appasamy,
>
> What does "not working" mean? Do you get an exception? If so, what
> exception and with what message? Do you get a resource and it just
> has no contents? Is this in an Eclipse context where you can see
> exceptions logged in the workspace log? There are so many reasons why
> this resource might not load as you would expect ...
>
> Cheers,
>
> Christian
>
>
> On 2012-10-16 11:35:47 +0000, Appasamy Thirugnana said:
>
>> Hi Everyone,
>>
>> I need to load a ecore file from my classpath
>>
>> ResourceSet resourceSet = new ResourceSetImpl();
>>
>>
>> resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(
>> "*", new EcoreResourceFactoryImpl() );
>>
>> final String[] ecores = new String[] {
>> "classpath:models//library.ecore" };
>>
>> for( String ecore : ecores ) {
>> final Resource res = resourceSet.getResource(
>> URI.createFileURI(ecore ), true );}...
>>
>> But it is not working.
>>
>> Can somebody tell me the correct way?
>>
>> Thanks,
>> Appasamy
>
>
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03598 seconds