This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
</li>
<li>
<api type="export" group="property" name="netbeans.user" category="devel">
NetBeans user directory.
NetBeans user directory. Right now it is allowed to contain string <q>memory</q>
and in such case the user directory is not created on disk, but is held in memory.
Also it can contain string <q>${user.home}/</q> which gets replaced
with the correct location of user directory.
</api>
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
/*
* 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);