Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » General (non-technical) » Eclipse Foundation » Converting a Java package name in an IPath instance
Converting a Java package name in an IPath instance [message #3335] Wed, 13 October 2004 17:44 Go to next message
Eclipse UserFriend
Originally posted by: angelorandazzo.yahoo.it

Hi,

I need to convert a package name (like 'myapp.mypackage.mysubpackage') in
an IPath instance (like '/myproject/mysrc/myapp/mypackage/mysubpackage').

How to obtain this? Anyone can help me? Thanks in advance.

BYE
Angelo
Re: Converting a Java package name in an IPath instance [message #3403 is a reply to message #3335] Wed, 13 October 2004 19:14 Go to previous messageGo to next message
Darin Swanson is currently offline Darin SwansonFriend
Messages: 2386
Registered: July 2009
Senior Member
Not a topic for this forum.
Please repost on eclipse.platform.

Thanks
Darins

"angelo randazzo" <angelorandazzo@yahoo.it> wrote in message
news:ckjph0$60k$1@eclipse.org...
> Hi,
>
> I need to convert a package name (like 'myapp.mypackage.mysubpackage') in
> an IPath instance (like '/myproject/mysrc/myapp/mypackage/mysubpackage').
>
> How to obtain this? Anyone can help me? Thanks in advance.
>
> BYE
> Angelo
>
Re: Converting a Java package name in an IPath instance [message #7549 is a reply to message #3335] Fri, 26 November 2004 10:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: asd.asd.com

convert your "myapp.mypackage....." to desired format "myapp/mypackage/.."
through String parsers.say the resultant String is "strpath"
Get the path of you project by calling :


IProject project =
ResourcesPlugin.getWorkspace().getRoot().getProject("myproject ");
//get a handle to IPath object
IPath path=project.getFullPath();
//append the desired String to modify the IPath object.
path.append("/src/"+strpath);
angelo randazzo wrote:

> Hi,

> I need to convert a package name (like 'myapp.mypackage.mysubpackage') in
> an IPath instance (like '/myproject/mysrc/myapp/mypackage/mysubpackage').

> How to obtain this? Anyone can help me? Thanks in advance.

> BYE
> Angelo
Re: Converting a Java package name in an IPath instance [message #7565 is a reply to message #3335] Fri, 26 November 2004 10:13 Go to previous message
Eclipse UserFriend
Originally posted by: asd.asd.com

I made a slight mistake in previous post

use this line
IPath newpath=path.append("/src/"+strpath);


instead of path.append()......;

angelo randazzo wrote:

> Hi,

> I need to convert a package name (like 'myapp.mypackage.mysubpackage') in
> an IPath instance (like '/myproject/mysrc/myapp/mypackage/mysubpackage').

> How to obtain this? Anyone can help me? Thanks in advance.

> BYE
> Angelo
Previous Topic:[PROJECT] - Localization and Translation Tools
Next Topic:Eclipse and Common LISP (?)
Goto Forum:
  


Current Time: Wed Apr 24 21:07:27 GMT 2024

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

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

Back to the top