Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to set and get a configuration file for a eclipse plugin
How to set and get a configuration file for a eclipse plugin [message #332217] Sat, 11 October 2008 09:22 Go to next message
Hao Missing name is currently offline Hao Missing nameFriend
Messages: 115
Registered: July 2009
Senior Member
I am developing a eclipse plug-in and have a configuration file which
contains the configuration information for the plug-in. These information
are not neccessary to be exposed to the plug-in user. So these information
are not preference. I would like to put the configuration file within the
plug-in such as the root folder of the plug-in jar or the .metadata area
of the plug-in. I am not sure which way is a better practice and how could
I retrieve the configuration file when plug-in is activated.

Highly appreciated for any suggestion!

hao
Re: How to set and get a configuration file for a eclipse plugin [message #332220 is a reply to message #332217] Sun, 12 October 2008 01:04 Go to previous messageGo to next message
Walter Harley is currently offline Walter HarleyFriend
Messages: 847
Registered: July 2009
Senior Member
"Hao " <d95776@yahoo.com> wrote in message
news:4c579dc9efae68d04f30666d971c8332$1@www.eclipse.org...
>I am developing a eclipse plug-in and have a configuration file which
>contains the configuration information for the plug-in. These information
>are not neccessary to be exposed to the plug-in user. So these information
>are not preference. I would like to put the configuration file within the
>plug-in such as the root folder of the plug-in jar or the .metadata area of
>the plug-in. I am not sure which way is a better practice and how could I
>retrieve the configuration file when plug-in is activated.
>
> Highly appreciated for any suggestion!


Try Platform.getStateLocation().

There are also a bunch of similar getXxxLocation() methods in Platform - you
might want to read the javadoc for all of them, to be sure you are thinking
about your problem correctly.
Re: How to set and get a configuration file for a eclipse plugin [message #332222 is a reply to message #332217] Sun, 12 October 2008 14:46 Go to previous messageGo to next message
Eclipse UserFriend
Hao schrieb:
> I am developing a eclipse plug-in and have a configuration file which
> contains the configuration information for the plug-in. These
> information are not neccessary to be exposed to the plug-in user. So
> these information are not preference. I would like to put the
> configuration file within the plug-in such as the root folder of the
> plug-in jar or the .metadata area of the plug-in. I am not sure which
> way is a better practice and how could I retrieve the configuration file
> when plug-in is activated.
>
> Highly appreciated for any suggestion!
>
> hao
>
Hi Hao,

for delivering the initial plug-in configuration, i would prefer to put
the properties file into the plug-in root directory. Your activator may
access the ressource via getBundle().getResource("props_file_name").

If you want to provide the ability of load/save an plug-in internal
state, then use the suggestion of Walter.

Holger
Re: How to set and get a configuration file for a eclipse plugin [message #332304 is a reply to message #332222] Fri, 17 October 2008 15:31 Go to previous message
Hao Missing name is currently offline Hao Missing nameFriend
Messages: 115
Registered: July 2009
Senior Member
[for delivering the initial plug-in configuration, i would prefer to put
the properties file into the plug-in root directory. Your activator may
access the ressource via getBundle().getResource("props_file_name").

If you want to provide the ability of load/save an plug-in internal
state, then use the suggestion of Walter.
]

You are right. I like your idea.

thanks!

hao
Previous Topic:Testing and Workspace Deletion
Next Topic:How to list all (non-default) remote feature site currently added?
Goto Forum:
  


Current Time: Sat Jul 13 19:56:14 GMT 2024

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

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

Back to the top