Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 11: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 12:23 Go to previous message
Jakub Jurkiewicz is currently offline Jakub JurkiewiczFriend
Messages: 38
Registered: July 2009
Member
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 Apr 26 11:56:27 GMT 2024

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

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

Back to the top