Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Path, devices and creatLink
Path, devices and creatLink [message #243685] Sat, 22 May 2004 17:07 Go to next message
Eclipse UserFriend
Hi all,

the following scenario:

I use Platform.asLocalURL() to get the local path of lets say a file.
location = Platfrom.asLocalURL(bundle.getEntry(...)).getPath()

On Windows this returns something like "/D:/some/path". I use this this
string to create a new Path. A Path with a leading "/" is created.

Using that path to create a link with folder.createLink(path, ...) will
result in a not usable link. That is because the link entry in the
..project file also contains the leading "/".

To work around that problem I use the URI implementation of EMF which
provides me a Path without the leading "/". I also tried to use
removeTrailingSeparator() without success. Since my project depends on
EMF that is no problem for me, but maybe for others.

How can I solve this in a clean way?

--
Alexander Rupsch
http://www.dreinhalb.de
Re: Path, devices and creatLink [message #246792 is a reply to message #243685] Fri, 28 May 2004 08:29 Go to previous messageGo to next message
Eclipse UserFriend
Alexander Rupsch wrote:
> Hi all,
>
> the following scenario:
>
> I use Platform.asLocalURL() to get the local path of lets say a file.
> location = Platfrom.asLocalURL(bundle.getEntry(...)).getPath()
>
> On Windows this returns something like "/D:/some/path". I use this this
> string to create a new Path. A Path with a leading "/" is created.
>
> Using that path to create a link with folder.createLink(path, ...) will
> result in a not usable link. That is because the link entry in the
> ..project file also contains the leading "/".
>
> To work around that problem I use the URI implementation of EMF which
> provides me a Path without the leading "/". I also tried to use
> removeTrailingSeparator() without success. Since my project depends on
> EMF that is no problem for me, but maybe for others.
>
> How can I solve this in a clean way?
>

I just replied to myself, since I can't believe that there isn't a
solution. But I think I shouldn't had post it on a weekend.... ;-)

--
Alexander Rupsch
http://www.dreinhalb.de
Re: Path, devices and creatLink [message #247628 is a reply to message #246792] Mon, 31 May 2004 14:31 Go to previous message
Eclipse UserFriend
Originally posted by: john.eclipsefaq.org

The solution is to remove the leading slash character before the device.
/D:/some/path is not a valid file system path.
--

> I just replied to myself, since I can't believe that there isn't a
> solution. But I think I shouldn't had post it on a weekend.... ;-)
>
Previous Topic:M9 Compare With gets errors
Next Topic:V3M8 archive flag not set
Goto Forum:
  


Current Time: Sun Jun 08 22:55:01 EDT 2025

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

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

Back to the top