Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Change path Product configuration files
Change path Product configuration files [message #463368] Fri, 09 February 2007 04:14 Go to next message
Eclipse UserFriend
Executing a RCP product, log files, status workbench (workbench.xml) and
several files are saved inside a path generated by
DataArea.getStateLocation(bundleName).

I need to generate this path in a especific path(different path of the
product path) because in executable directory we don’t have write
permissions.

How can we change this path of elegant way? Can it be changed in some
configuration file?

This is very important. Thanks for any help.
Angel
Re: Change path Product configuration files [message #463378 is a reply to message #463368] Fri, 09 February 2007 09:33 Go to previous messageGo to next message
Eclipse UserFriend
Hi Angel,

What you're referring to is called the instance area, and it can be set
via the osgi.instance.area property in your config.ini or by passing it as
the -data parameter on the command line.

--- Patrick
patrick@rcpquickstart.com

Angel wrote:

> Executing a RCP product, log files, status workbench (workbench.xml) and
> several files are saved inside a path generated by
> DataArea.getStateLocation(bundleName).

> I need to generate this path in a especific path(different path of the
> product path) because in executable directory we don’t have write
> permissions.

> How can we change this path of elegant way? Can it be changed in some
> configuration file?

> This is very important. Thanks for any help.
> Angel
Re: Change path Product configuration files [message #463437 is a reply to message #463368] Mon, 12 February 2007 07:19 Go to previous message
Eclipse UserFriend
Angel wrote:
> Executing a RCP product, log files, status workbench (workbench.xml) and
> several files are saved inside a path generated by
> DataArea.getStateLocation(bundleName).
[..]
> How can we change this path of elegant way? Can it be changed in some
> configuration file?

The most general solution is to do the following:

1) Add "-data @noDefault" to your program arguments (i.g. in your
launch config and in your .product file on "Launcher" page.
2) Define your IPlatformRunnable in a way that programmatically sets the
workspace location *before* PlatformUI.createAndRunWorkbench() is
invoked (see (3))
3) To realize (2) have a look at IDEApplication.java
(org.eclipse.platform.source) or use something the following:

final Location instanceLoc = Platform.getInstanceLocation();
if (instanceLoc == null) {
.. //handle error
}

final URL userWSURL;

try {
String path = fUserWorkspace.getAbsolutePath().replace(
File.separatorChar, '/');
userWSURL = new URL("file", null, path); //$NON-NLS-1$
} catch (MalformedURLException e) {
.. //handle error
}

if (instanceLoc.isSet()) {
if (!userWSURL.sameFile(instanceLoc.getURL())) {
.. //handle error
}
} else {
if (!fUserWorkspace.exists()) {
if (!fUserWorkspace.mkdirs()) {
.. //handle error
}
}

final boolean doLock = ...; // Set your locking policy

if (!instanceLoc.setURL(userWSURL, doLock) == doLock) {
.. //handle error
}
}

Greetings from Bremen,

Daniel Krügler
Previous Topic:Adding a property page to a project
Next Topic:Auto Hide/show Navigator
Goto Forum:
  


Current Time: Sat Mar 22 12:42:26 EDT 2025

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

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

Back to the top