|
Re: Problem loading platform resource with space in name [message #393618 is a reply to message #393614] |
Mon, 20 June 2005 19:40 |
Marcelo Paternostro Messages: 602 Registered: July 2009 |
Senior Member |
|
|
Hi Dave,
Thanks for reporting this problem. I believe the fix is to call
URI.createPlatformURI(String, true) instead of
URI.createPlatformURI(String).
Please open a bugzilla. We may have a window to fix it in 2.1.0.
Cheers,
Marcelo
Dave Carlson wrote:
> I am tracking down a bug caused when attempting to load a platform resource
> into a ResoruceSet, using the "Load Resource..." menu action. When the file
> or folder name contains a space, the load fails becuase the list of selected
> names is parsed with a string tokenizer. Maybe you should use a character
> other than space for spliting the list of selected names?
>
> This calls the following method in URI class, which tests a System property.
> I can't find any way to set this system property in my application, prior to
> it being set in a static variable. I don't want to require a -D option on
> the Eclipse platform startup command...
>
> Any suggestions? Thanks.
>
> // We can't want to do encoding of platform resource URIs by default yet.
> //
> private static final boolean ENCODE_PLATFORM_RESOURCE_URIS =
> System.getProperty("org.eclipse.emf.common.util.URI.encodePlatformResourceURIs ")
> != null &&
> !"false".equalsIgnoreCase(System.getProperty("org.eclipse.emf.common.util.URI.encodePlatformResourceURIs "));
>
>
> public static URI createPlatformResourceURI(String pathName)
> {
> if (ENCODE_PLATFORM_RESOURCE_URIS)
> {
> pathName = encode(pathName, PATH_CHAR_HI, PATH_CHAR_LO, false);
> }
> URI result = createURI((pathName.charAt(0) == SEGMENT_SEPARATOR ?
> "platform:/resource" : "platform:/resource/") + pathName);
> return result;
> }
>
>
>
|
|
|
Re: Problem loading platform resource with space in name [message #393621 is a reply to message #393618] |
Mon, 20 June 2005 19:54 |
Dave Carlson Messages: 402 Registered: July 2009 |
Senior Member |
|
|
Thanks Marcelo, I opened this bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=100952
"Marcelo Paternostro" <marcelop@ca.ibm.com> wrote in message
news:d9763n$782$1@news.eclipse.org...
> Hi Dave,
>
> Thanks for reporting this problem. I believe the fix is to call
> URI.createPlatformURI(String, true) instead of
> URI.createPlatformURI(String).
>
> Please open a bugzilla. We may have a window to fix it in 2.1.0.
>
> Cheers,
> Marcelo
>
> Dave Carlson wrote:
>> I am tracking down a bug caused when attempting to load a platform
>> resource into a ResoruceSet, using the "Load Resource..." menu action.
>> When the file or folder name contains a space, the load fails becuase the
>> list of selected names is parsed with a string tokenizer. Maybe you
>> should use a character other than space for spliting the list of selected
>> names?
>>
>> This calls the following method in URI class, which tests a System
>> property. I can't find any way to set this system property in my
>> application, prior to it being set in a static variable. I don't want to
>> require a -D option on the Eclipse platform startup command...
>>
>> Any suggestions? Thanks.
>>
>> // We can't want to do encoding of platform resource URIs by default
>> yet.
>> //
>> private static final boolean ENCODE_PLATFORM_RESOURCE_URIS =
>>
>> System.getProperty("org.eclipse.emf.common.util.URI.encodePlatformResourceURIs ")
>> != null &&
>>
>> !"false".equalsIgnoreCase(System.getProperty("org.eclipse.emf.common.util.URI.encodePlatformResourceURIs "));
>>
>>
>> public static URI createPlatformResourceURI(String pathName)
>> {
>> if (ENCODE_PLATFORM_RESOURCE_URIS)
>> {
>> pathName = encode(pathName, PATH_CHAR_HI, PATH_CHAR_LO, false);
>> }
>> URI result = createURI((pathName.charAt(0) == SEGMENT_SEPARATOR ?
>> "platform:/resource" : "platform:/resource/") + pathName);
>> return result;
>> }
>>
>>
|
|
|
Powered by
FUDForum. Page generated in 0.03369 seconds