Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Problem loading platform resource with space in name
Problem loading platform resource with space in name [message #393614] Mon, 20 June 2005 17:18 Go to next message
Dave Carlson is currently offline Dave CarlsonFriend
Messages: 402
Registered: July 2009
Senior Member
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 #393618 is a reply to message #393614] Mon, 20 June 2005 19:40 Go to previous messageGo to next message
Marcelo Paternostro is currently offline Marcelo PaternostroFriend
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 Go to previous message
Dave Carlson is currently offline Dave CarlsonFriend
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;
>> }
>>
>>
Previous Topic:Issue with xsd:union types on instance level: missing xsi:type attribute
Next Topic:Creating multi-valued attributes with XML Schema
Goto Forum:
  


Current Time: Mon Sep 23 05:16:42 GMT 2024

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

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

Back to the top