|
Re: Backslashes and spaces in EMF URI's [message #416515 is a reply to message #416514] |
Wed, 06 February 2008 14:49 |
David Steinberg Messages: 489 Registered: July 2009 |
Senior Member |
|
|
Jasper wrote:
> It appears that ResourceSetImpl#getResource(URI,boolean) chokes on any
> URI with a %20 (space) in it if its a URI with an archive scheme. See
> stacktrace below.
>
> Seems to me that the URI isn't being decoded, whereas it is when the URI
> is not an archive scheme. Is this a bug?
Hi Jasper,
Yes, this appears to me to be a bug. Please open a bugzilla.
By the way, it's helpful to mention the version of EMF you're using when
you give a strack trace.
> On a related note: Why does URI#createURI(String) not take care of
> encoding, while URI#createURI(String, boolean) and other creational
> methods do?
Because sometimes you know you don't need any encoding, such as when
you're creating a URI for a literal string or when you've already done
the encoding, so it's handy to be able to skip it.
Cheers,
Dave
|
|
|
Re: Backslashes and spaces in EMF URI's [message #416592 is a reply to message #416515] |
Thu, 07 February 2008 08:27 |
Jasper Messages: 84 Registered: July 2009 |
Member |
|
|
OK, bug #218130.
Thanks,
Jasper.
Dave Steinberg wrote:
> Jasper wrote:
>> It appears that ResourceSetImpl#getResource(URI,boolean) chokes on any
>> URI with a %20 (space) in it if its a URI with an archive scheme. See
>> stacktrace below.
>>
>> Seems to me that the URI isn't being decoded, whereas it is when the
>> URI is not an archive scheme. Is this a bug?
>
> Hi Jasper,
>
> Yes, this appears to me to be a bug. Please open a bugzilla.
>
> By the way, it's helpful to mention the version of EMF you're using when
> you give a strack trace.
>
>> On a related note: Why does URI#createURI(String) not take care of
>> encoding, while URI#createURI(String, boolean) and other creational
>> methods do?
>
> Because sometimes you know you don't need any encoding, such as when
> you're creating a URI for a literal string or when you've already done
> the encoding, so it's handy to be able to skip it.
>
> Cheers,
> Dave
|
|
|
|
Re: Backslashes and spaces in EMF URI's [message #1053532 is a reply to message #1053522] |
Mon, 06 May 2013 12:16 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
Marek,
Well that depends on how the URI is constructed, but yes,
URI.createFileURI and URI.createPlatform*URI will generally (the latter
depending on the argument, but specifying true is strongly encouraged)
encode characters such as space which are not strictly valid according
to the URI RFC. You can always use URI.decode to decode strings, and
methods like URI.toFileString and URI.toPlatformString will generally do
that decoding for you to produce OS-specific valid file system paths or
Eclipse valid resource paths. Failure to encode URIs can cause nasty
problems in deserialization, i.e., a URI with a space could end up being
interpreted as two separate URIs...
On 06/05/2013 1:17 PM, Marek Jagielski wrote:
> Hi,
> I have EMF 2.6.0 v.20120917. Is it normal behavior that
> myUri.segment(1) gives me a String with encoded spaces (%20) ? Thanks,
>
> Marek
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02932 seconds