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.

View | Details | Raw Unified | Return to bug 62565
Collapse All | Expand All

(-)core/arch/arch-core-launcher.xml (-1 / +4 lines)
Lines 451-457 Link Here
451
            </li>
451
            </li>
452
            <li>
452
            <li>
453
                <api type="export" group="property" name="netbeans.user" category="devel">
453
                <api type="export" group="property" name="netbeans.user" category="devel">
454
                    NetBeans user directory.
454
                    NetBeans user directory. Right now it is allowed to contain string <q>memory</q>
455
                    and in such case the user directory is not created on disk, but is held in memory.
456
                    Also it can contain string <q>${user.home}/</q> which gets replaced
457
                    with the correct location of user directory.
455
                </api>
458
                </api>
456
            </li>
459
            </li>
457
            <li>
460
            <li>
(-)core/startup/src/org/netbeans/core/startup/CLIOptions.java (+2 lines)
Lines 264-269 Link Here
264
                System.err.println(NbBundle.getMessage(CLIOptions.class, "ERR_user_directory_is_home"));
264
                System.err.println(NbBundle.getMessage(CLIOptions.class, "ERR_user_directory_is_home"));
265
                org.netbeans.TopSecurityManager.exit(1);
265
                org.netbeans.TopSecurityManager.exit(1);
266
            }
266
            }
267
268
            userDir = userDir.replace("${user.home}/", System.getProperty("user.home") + File.separator);
267
            
269
            
268
            /** #11735. Relative userDir is converted to absolute*/
270
            /** #11735. Relative userDir is converted to absolute*/
269
            // #21085: userDir might contain ../ sequences which should be removed
271
            // #21085: userDir might contain ../ sequences which should be removed
(-)core/startup/test/unit/src/org/netbeans/core/startup/CLIOptionsTest.java (+52 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 *
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 *
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.netbeans.core.startup;
15
16
import junit.framework.*;
17
import java.awt.*;
18
import java.awt.event.*;
19
import java.beans.*;
20
import java.io.*;
21
import java.security.*;
22
import java.util.Locale;
23
import javax.swing.*;
24
import javax.swing.border.*;
25
import org.netbeans.CLIHandler;
26
import org.openide.util.NbBundle;
27
28
/** Check certain CLIOptions behaviour.
29
 *
30
 * @author Jaroslav Tulach
31
 */
32
public class CLIOptionsTest extends TestCase {
33
    
34
    public CLIOptionsTest(String testName) {
35
        super(testName);
36
    }
37
38
    protected void setUp() throws Exception {
39
    }
40
41
    protected void tearDown() throws Exception {
42
    }
43
44
    public void testGetUserDir() {
45
        System.setProperty("netbeans.user", "${user.home}/mine");
46
        
47
        String expResult = System.getProperty("user.home") + File.separator + "mine";
48
        String result = CLIOptions.getUserDir();
49
        assertEquals(expResult, result);
50
    }
51
52
}

Return to bug 62565