Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » IFolder.move() gives exception on windows machine(IFolder.move() gives exception on windows machine)
IFolder.move() gives exception on windows machine [message #516543] Wed, 24 February 2010 11:37 Go to next message
Ibrahim  is currently offline Ibrahim Friend
Messages: 8
Registered: February 2010
Junior Member
Hi, I am trying to move a resource (IFolder) from one location to another location inside the project through IFolder.move() API as follows:

dataFolder.move(project.getLocation(), true, null);

The problem I am getting is, I am running it on the Windows platform and the first parameter IPath resolves to the file system path as: 'C:/workspace/project'. And move() gives me CoreException as : ":" is an invalid character in path.

Has anyone faced this similar issue?

[Updated on: Wed, 24 February 2010 12:31]

Report message to a moderator

Re: IFolder.move() gives exception on windows machine [message #516550 is a reply to message #516543] Wed, 24 February 2010 11:43 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Ibrahim,

Isn't that argument supposed to be a workspace relative path rather than
an absolute file system location? I.e., /project/folder1/folder2.


Ibrahim wrote:
> Hi, I am trying to move a resource (IFolder) from one location to
> another location inside the project through IFolder.move() API as
> follows:
>
> dataFolder.move(project.getLocation(), true, null);
>
> The problem I am getting is, I am running it on the Windows platform
> and the first parameter IPath resolves to the file system path as:
> 'C:/workspace/project'. And move() gives me CoreException as : ":" is
> an invalid character in path.
>
> Has anyone faced this similar issue?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: IFolder.move() gives exception on windows machine [message #516772 is a reply to message #516550] Thu, 25 February 2010 06:06 Go to previous messageGo to next message
Ibrahim  is currently offline Ibrahim Friend
Messages: 8
Registered: February 2010
Junior Member
Hi, can u guide me how to get the Project relative path?
to me IProject.getProjectRelativePath() is not giving the path I expect. Its giving the path like /project/folder1 but I need /project, because here only i want to move the folder.

Also, I have one more doubt since I am new to this forum. I cannot see this posting under Eclipse Platform forum or anywhere either. It is not listed here though I posted it here. I have to go to Home>Control Panel>Show own posts to get to see this topic. Why is it so?

[Updated on: Thu, 25 February 2010 06:11]

Report message to a moderator

Re: IFolder.move() gives exception on windows machine [message #516854 is a reply to message #516772] Thu, 25 February 2010 11:24 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Ibrahim,

A workspace relative path is of the form /<project-name>. You're the
one doing the moving so you need to specify where to move it in the
workspace. Note that I've been taking about getFullPath, not about
getProjectRelativePath.


Ibrahim wrote:
> Hi, can u guide me how to get the Project relative path?
> to me IProject.getProjectRelativePath() is not giving the path I
> expected.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[Databinding] Performance issues with IObservableMap and non-trivial table sizes
Next Topic:Creating dynamic tooltips on a views toolbar
Goto Forum:
  


Current Time: Fri Apr 19 13:07:03 GMT 2024

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

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

Back to the top