Couldn't open a file using path variable not accepting space [message #466400] |
Wed, 18 April 2007 07:34  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.23318 seconds