Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Couldn't open a file using path variable not accepting space
Couldn't open a file using path variable not accepting space [message #466400] Wed, 18 April 2007 07:34 Go to next message
Eclipse UserFriend
Originally posted by: badreddine49.yahoo.fr

Hi,
I have a problem, in my plugin I call a file by using this methode to obtain his path variable:
<i>public static String getPath() { return(plugin.getBundle().getLocation()); }</i>
I got an error, when the path of the file contain a space character!!?

How can I resolve this problem?
Thanks

badr
Re: Couldn't open a file using path variable not accepting space [message #466402 is a reply to message #466400] Wed, 18 April 2007 08:23 Go to previous message
Eclipse UserFriend
Hi,

Try this:
Bundle bundle = Platform.getBundle(PLUGIN_ID);
Path path = new Path("");
URL url = FileLocator.find(bundle, path, null);
try {
url = FileLocator.resolve(url);
} catch (IOException e) {
// exception handling
}
return url.getPath();

Hope this helps,
Jakub Jurkiewicz

badr wrote:
> Hi,
> I have a problem, in my plugin I call a file by using this methode to obtain his path variable:
> <i>public static String getPath() { return(plugin.getBundle().getLocation()); }</i>
> I got an error, when the path of the file contain a space character!!?
>
> How can I resolve this problem?
> Thanks
>
> badr
Previous Topic:line tracking
Next Topic:Show view in another perspective
Goto Forum:
  


Current Time: Fri Jul 04 21:21:53 EDT 2025

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

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

Back to the top