Index: core/arch/arch-core-launcher.xml
===================================================================
RCS file: /cvs/core/arch/arch-core-launcher.xml,v
retrieving revision 1.30
diff -u -r1.30 arch-core-launcher.xml
--- core/arch/arch-core-launcher.xml 10 Aug 2005 19:26:22 -0000 1.30
+++ core/arch/arch-core-launcher.xml 18 Aug 2005 10:07:13 -0000
@@ -451,7 +451,10 @@
- NetBeans user directory.
+ NetBeans user directory. Right now it is allowed to contain string memory
+ and in such case the user directory is not created on disk, but is held in memory.
+ Also it can contain string ${user.home}/
which gets replaced
+ with the correct location of user directory.
Index: core/startup/src/org/netbeans/core/startup/CLIOptions.java
===================================================================
RCS file: /cvs/core/startup/src/org/netbeans/core/startup/CLIOptions.java,v
retrieving revision 1.1
diff -u -r1.1 CLIOptions.java
--- core/startup/src/org/netbeans/core/startup/CLIOptions.java 4 Jun 2005 05:11:42 -0000 1.1
+++ core/startup/src/org/netbeans/core/startup/CLIOptions.java 18 Aug 2005 10:07:13 -0000
@@ -264,6 +264,8 @@
System.err.println(NbBundle.getMessage(CLIOptions.class, "ERR_user_directory_is_home"));
org.netbeans.TopSecurityManager.exit(1);
}
+
+ userDir = userDir.replace("${user.home}/", System.getProperty("user.home") + File.separator);
/** #11735. Relative userDir is converted to absolute*/
// #21085: userDir might contain ../ sequences which should be removed
Index: core/startup/test/unit/src/org/netbeans/core/startup/CLIOptionsTest.java
===================================================================
RCS file: core/startup/test/unit/src/org/netbeans/core/startup/CLIOptionsTest.java
diff -N core/startup/test/unit/src/org/netbeans/core/startup/CLIOptionsTest.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ core/startup/test/unit/src/org/netbeans/core/startup/CLIOptionsTest.java 18 Aug 2005 10:07:13 -0000
@@ -0,0 +1,52 @@
+/*
+ * Sun Public License Notice
+ *
+ * The contents of this file are subject to the Sun Public License
+ * Version 1.0 (the "License"). You may not use this file except in
+ * compliance with the License. A copy of the License is available at
+ * http://www.sun.com/
+ *
+ * The Original Code is NetBeans. The Initial Developer of the Original
+ * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
+ * Microsystems, Inc. All Rights Reserved.
+ */
+
+package org.netbeans.core.startup;
+
+import junit.framework.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.beans.*;
+import java.io.*;
+import java.security.*;
+import java.util.Locale;
+import javax.swing.*;
+import javax.swing.border.*;
+import org.netbeans.CLIHandler;
+import org.openide.util.NbBundle;
+
+/** Check certain CLIOptions behaviour.
+ *
+ * @author Jaroslav Tulach
+ */
+public class CLIOptionsTest extends TestCase {
+
+ public CLIOptionsTest(String testName) {
+ super(testName);
+ }
+
+ protected void setUp() throws Exception {
+ }
+
+ protected void tearDown() throws Exception {
+ }
+
+ public void testGetUserDir() {
+ System.setProperty("netbeans.user", "${user.home}/mine");
+
+ String expResult = System.getProperty("user.home") + File.separator + "mine";
+ String result = CLIOptions.getUserDir();
+ assertEquals(expResult, result);
+ }
+
+}