Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » File for Plugin at installation time
File for Plugin at installation time [message #300101] Thu, 02 March 2006 05:25 Go to next message
Eclipse UserFriend
Originally posted by: the.dodger.gmail.com

Hi all.

I'm developing a plugin for eclipse. It keeps data in its working
directory under the workspace .metadata\.plugins subdirectory. As example,
it uses the file:

<workspace>\.metadata\.plugins\com.test.example\data.dat

Inside the plugin, I can write and read the file using the function:

private File getDataFile(){
IPath path = ExamplePlugin.getDefault().getStateLocation();
path = path.append("data.dat");
return path.toFile();
}

All of this works fine.


Now, I'm developing a local eclipse-site for the installation of the
plugin. And I need copy a first "data.dat" file into the path
"<workspace>\.metadata\.plugins\com.test.example\" at installation time.
Is it possible? How can I copy a file in the working directory of a plugin?

Help me, please, I'm stuck with this :(

Thxs in advance

-dodger-
Re: File for Plugin at installation time [message #300110 is a reply to message #300101] Thu, 02 March 2006 07:41 Go to previous message
Eclipse UserFriend
Put your default data.dat as a resource in your plugin somewhere. When
you get your File, check to see if it exists. If it does, use it. If
it doesn't, then copy the resource version of data.dat out of the
classpath and into the File.

Later,
PW
Previous Topic:Eclipse builders - dependencies
Next Topic:Refactoring plugin
Goto Forum:
  


Current Time: Sat Jul 26 19:38:37 EDT 2025

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

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

Back to the top