Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Writing file to .eclipse (Unix) or Application Data (Win32)
Writing file to .eclipse (Unix) or Application Data (Win32) [message #330656] Thu, 07 August 2008 14:22 Go to next message
Mark Melia is currently offline Mark MeliaFriend
Messages: 142
Registered: July 2009
Senior Member
Hi,

Does anyone know how to write a file to a user's .eclipse directory in
unix systems and the application data directory for eclipse in win32
systems?

Thanks,
Mark
Re: Writing file to .eclipse (Unix) or Application Data (Win32) [message #330661 is a reply to message #330656] Thu, 07 August 2008 17:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Mark Melia wrote:
> Hi,
>
> Does anyone know how to write a file to a user's .eclipse directory in
> unix systems and the application data directory for eclipse in win32
> systems?

I don't know about unix, but Eclipse does not use an application data
directory on Windows. If you do something that triggers the so-called
"secure storage" facility (such as save a CVS password), it will write
something in a .eclipse directory under your home directory, but I don't
think there is anything special it does to accomplish that. I'd just use
something like:

String eclipseDir =
FilenameUtils.concat(System.getProperty("user.home"), ".eclipse");
String fileName = FilenameUtils.concat(eclipseDir, "myFile.txt");
FileUtils.writeStringToFile(new File(fileName), someData);

(using Jakarta IOUtils for FilenameUtils and FileUtils)

Hope this helps,
Eric
Re: Writing file to .eclipse (Unix) or Application Data (Win32) [message #330665 is a reply to message #330656] Thu, 07 August 2008 18:16 Go to previous message
Eclipse UserFriend
Originally posted by: mike.morearty.com

Depending on what you want to do, class org.eclipse.core.runtime.Platform
has several static functions that may help: getInstanceLocation(),
getUserLocation(), and several other getXxxLocation() functions.

I would also recommend reading
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse. platform.doc.isv/reference/misc/multi_user_installs.html
-- it gives some background on a number of different ways that an Eclipse
installation can be configured.

- Mike
Previous Topic:is org.eclipse.core.internal.dtree.DeltaDataTree leeking memory?
Next Topic:initializationError0 When Running JUnits Through Eclipse
Goto Forum:
  


Current Time: Thu Jul 18 00:17:02 GMT 2024

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

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

Back to the top