Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Getting a file system path from a platform URI
Getting a file system path from a platform URI [message #293955] Thu, 03 November 2005 00:57 Go to next message
Don Leckie is currently offline Don LeckieFriend
Messages: 41
Registered: July 2009
Member
Hi,

I've been struggling with this all afternoon. I've searched the Eclipse and
EMF classes and couldn't find a method that would convert a Platform URI
into a File URI. I need to get the full file system path of the Platform
URI. In the code that I'm modifying I have no access to a ResourceSet and
any Resources.

Any ideas?

Thank you,
Don
Re: Getting a file system path from a platform URI [message #293956 is a reply to message #293955] Thu, 03 November 2005 01:02 Go to previous messageGo to next message
Don Leckie is currently offline Don LeckieFriend
Messages: 41
Registered: July 2009
Member
Hi,

I need the full file system path so that I can create an IPath that is a
parameter to a method.

Thank you,
Don


"Don Leckie" <don@leckieinc.com> wrote in message
news:dkbn9f$hmu$1@news.eclipse.org...
> Hi,
>
> I've been struggling with this all afternoon. I've searched the Eclipse
> and EMF classes and couldn't find a method that would convert a Platform
> URI into a File URI. I need to get the full file system path of the
> Platform URI. In the code that I'm modifying I have no access to a
> ResourceSet and any Resources.
>
> Any ideas?
>
> Thank you,
> Don
>
Re: Getting a file system path from a platform URI [message #293973 is a reply to message #293956] Thu, 03 November 2005 11:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: automatic.javalobby.org

Try this ..

URL pluginURL = Platform.resolve(YourPlugin.getDefault()
                         .getBundle().getEntry("/"));
IPath pluginPath = new Path(pluginURL .toString());


Thanks
Venkat
Re: Getting a file system path from a platform URI [message #293981 is a reply to message #293955] Thu, 03 November 2005 13:42 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Platform.resolve(URL url) and Platform.asLocalURL(URL url)

asLocalURL() is useful for plugin files, since if the plugin is jarred
it will extract the file so that it's a valid file:// URL.

Later,
PW


Re: Getting a file system path from a platform URI [message #294069 is a reply to message #293973] Thu, 03 November 2005 19:23 Go to previous messageGo to next message
Don Leckie is currently offline Don LeckieFriend
Messages: 41
Registered: July 2009
Member
Thanks!

Don




"venkataramana" <automatic@javalobby.org> wrote in message
news:17896913.1131018270371.JavaMail.root@cp1.javalobby.org...
> Try this ..
>
>
> URL pluginURL = Platform.resolve(YourPlugin.getDefault()
>                         .getBundle().getEntry("/"));
> IPath pluginPath = new Path(pluginURL .toString());
> 

>
> Thanks
> Venkat
Re: Getting a file system path from a platform URI [message #294070 is a reply to message #293981] Thu, 03 November 2005 19:23 Go to previous message
Don Leckie is currently offline Don LeckieFriend
Messages: 41
Registered: July 2009
Member
Thanks!

Don



"Paul Webster" <pwebster@ca.ibm.com> wrote in message
news:dkd44c$6tr$1@news.eclipse.org...
> Platform.resolve(URL url) and Platform.asLocalURL(URL url)
>
> asLocalURL() is useful for plugin files, since if the plugin is jarred it
> will extract the file so that it's a valid file:// URL.
>
> Later,
> PW
Previous Topic:Problems in context menus with objectContributions from 'org.eclipse.debug.ui', eclipse 3.0.2
Next Topic:'cvs remove' not implemented?
Goto Forum:
  


Current Time: Tue Sep 24 22:14:54 GMT 2024

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

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

Back to the top