Forum Controls
Spotlight Features

The Rich Engineering Heritage Behind Dependency Injection

Andrew McVeigh takes us on a tour of the rich heritage behind dependency injection, what it represents, and tells us why its here to stay.

Java, the OLPC, and community responsibility

The "One Laptop Per Child" project has a great device ready to ship, but there's no Java on there. Let's think about working together to put Java on OLPC!
Replies: 2 - Pages: 1  
Threads: [ Previous | Next ]
  Click to reply to this thread Reply

Writing file to .eclipse (Unix) or Application Data (Win32)

At 10:22 AM on Aug 7, 2008, 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?

Thanks,
Mark

  Click to reply to this thread Reply
1. At 1:07 PM on Aug 7, 2008, Eric Rizzo wrote:

Re: Writing file to .eclipse (Unix) or Application Data (Win32)

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
  Click to reply to this thread Reply
2. At 2:16 PM on Aug 7, 2008, Mike Morearty Javalobby Newcomers wrote:

Re: Writing file to .eclipse (Unix) or Application Data (Win32)

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


thread.rss_message