Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Upper case letters in URI
Upper case letters in URI [message #1162105] Wed, 30 October 2013 06:43 Go to next message
Sudarsan Gokhale Raghunath is currently offline Sudarsan Gokhale RaghunathFriend
Messages: 3
Registered: March 2012
Junior Member
Hi,

I have specialized serializing the non-containment proxy URIs by overriding deresolve(URI uri) method of XMLHelperImpl class.

I transform the standard platform resource (or file) URIs to a format as follows:

Platform Resource URI:
platform:/resource/uppercasepkgtests/sales_2014.epm#/

Transformed URI String:
UPPERCASEPKGTESTS::sales_2014.epm

Now, when I try to create a URI using createURI(String s) method of org.eclipse.emf.common.util.URI class, since it automatically identifies the portion "UPPERCASEPKGTESTS:" as scheme, and according to bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=403093 , I understood that the scheme will always be stored in 'lower case' letters.

I would like to know how to get around with this issue, so that the EMF serialization and deserialization keeps the format of Transformed URI string intact (with capitalized letters) so that I can transform from the transformed URI string to platform or file URI string (and vice versa) correctly. Actually I don't want the scheme to be automatically interpreted at all.

When I tried to test the behavior by modifying the proxy URI in the file manually to uppercase letters, during deserialization, EMF automatically again interprets scheme and converts into lower case letters. I would like to override this too.

Thank you,
Sudarsan
Re: Upper case letters in URI [message #1162141 is a reply to message #1162105] Wed, 30 October 2013 07:15 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33218
Registered: July 2009
Senior Member
Sudarsan,

Sorry, you have no control over that. The URI specification spells that:

Scheme names consist of a sequence of characters beginning with a
lower case letter and followed by any combination of lower case
letters, digits, plus ("+"), period ("."), or hyphen ("-"). For
resiliency, programs interpreting URI should treat upper case letters
as equivalent to lower case in scheme names (e.g., allow "HTTP" as
well as "http").

So if you use a URI with a scheme you should expect that those letters
will be treated as lower case. If case is significant and important
for this component of your URI, you should use not specify that
information as part of the scheme.

On 30/10/2013 7:43 AM, Sudarsan Gokhale Raghunath wrote:
> Hi,
>
> I have specialized serializing the non-containment proxy URIs by
> overriding deresolve(URI uri) method of XMLHelperImpl class.
>
> I transform the standard platform resource (or file) URIs to a format
> as follows:
>
> Platform Resource URI:
> platform:/resource/uppercasepkgtests/sales_2014.epm#/
>
> Transformed URI String:
> UPPERCASEPKGTESTS::sales_2014.epm
>
> Now, when I try to create a URI using createURI(String s) method of
> org.eclipse.emf.common.util.URI class, since it automatically
> identifies the portion "UPPERCASEPKGTESTS:" as scheme, and according
> to bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=403093 , I
> understood that the scheme will always be stored in 'lower case' letters.
>
> I would like to know how to get around with this issue, so that the
> EMF serialization and deserialization keeps the format of Transformed
> URI string intact (with capitalized letters) so that I can transform
> from the transformed URI string to platform or file URI string (and
> vice versa) correctly. Actually I don't want the scheme to be
> automatically interpreted at all.
>
> When I tried to test the behavior by modifying the proxy URI in the
> file manually to uppercase letters, during deserialization, EMF
> automatically again interprets scheme and converts into lower case
> letters. I would like to override this too.
>
> Thank you,
> Sudarsan


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:XSD to ECore changing element class
Next Topic:[xcore] How to migrate from ecore/genmodel
Goto Forum:
  


Current Time: Wed Sep 25 04:03:13 GMT 2024

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

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

Back to the top