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 198484
Collapse All | Expand All

(-)a/autoupdate.services/libsrc/org/netbeans/updater/ModuleUpdater.java (-3 / +6 lines)
Lines 665-671 Link Here
665
    }
665
    }
666
666
667
    /** Gets the netbeans directory */
667
    /** Gets the netbeans directory */
668
    private File getMainDirectory (File activeCluster) {
668
    private static File getMainDirectory (File activeCluster) {
669
        // #72918: Post-install cannot write into platform cluster
669
        // #72918: Post-install cannot write into platform cluster
670
        File mainDirectory = new File (activeCluster, UpdateTracking.FILE_SEPARATOR + UpdaterDispatcher.UPDATE_DIR + UpdateTracking.FILE_SEPARATOR + UPDATE_MAIN_DIR);
670
        File mainDirectory = new File (activeCluster, UpdateTracking.FILE_SEPARATOR + UpdaterDispatcher.UPDATE_DIR + UpdateTracking.FILE_SEPARATOR + UPDATE_MAIN_DIR);
671
        if (! mainDirectory.isDirectory ()) {
671
        if (! mainDirectory.isDirectory ()) {
Lines 675-681 Link Here
675
        return mainDirectory;
675
        return mainDirectory;
676
    }
676
    }
677
    
677
    
678
    private String getMainDirString (File activeCluster) {
678
    private static String getMainDirString (File activeCluster) {
679
        return getMainDirectory (activeCluster).getPath ();
679
        return getMainDirectory (activeCluster).getPath ();
680
    }
680
    }
681
    
681
    
Lines 928-934 Link Here
928
928
929
    
929
    
930
    /** read jvm parameters from jvm parameters file */
930
    /** read jvm parameters from jvm parameters file */
931
    class MainConfig extends Object {
931
    static class MainConfig extends Object {
932
        
932
        
933
        /** The names of properties from jvm parameters file */
933
        /** The names of properties from jvm parameters file */
934
        private final String PAR_MAIN = "mainClass";               // NOI18N
934
        private final String PAR_MAIN = "mainClass";               // NOI18N
Lines 940-945 Link Here
940
        private final String VAR_IDE_HOME = "%IDE_HOME%";          // NOI18N
940
        private final String VAR_IDE_HOME = "%IDE_HOME%";          // NOI18N
941
        private final String VAR_IDE_USER = "%IDE_USER%";          // NOI18N
941
        private final String VAR_IDE_USER = "%IDE_USER%";          // NOI18N
942
        private final String VAR_FILE_SEPARATOR = "%FS%";          // NOI18N        
942
        private final String VAR_FILE_SEPARATOR = "%FS%";          // NOI18N        
943
        private final String VAR_PATH_SEPARATOR = "%PS%";          // NOI18N        
943
        private final String VAR_JAVA_HOME = "%JAVA_HOME%";        // NOI18N        
944
        private final String VAR_JAVA_HOME = "%JAVA_HOME%";        // NOI18N        
944
    
945
    
945
        /** joined all parameters of jvm java command */
946
        /** joined all parameters of jvm java command */
Lines 1022-1027 Link Here
1022
                UpdateTracking.getUserDir () == null ? "" : UpdateTracking.getUserDir ().getPath());
1023
                UpdateTracking.getUserDir () == null ? "" : UpdateTracking.getUserDir ().getPath());
1023
            original = replaceAll(original, VAR_FILE_SEPARATOR,
1024
            original = replaceAll(original, VAR_FILE_SEPARATOR,
1024
                UpdateTracking.FILE_SEPARATOR);            
1025
                UpdateTracking.FILE_SEPARATOR);            
1026
            original = replaceAll(original, VAR_PATH_SEPARATOR,
1027
                UpdateTracking.PATH_SEPARATOR);            
1025
            original = replaceAll(original, VAR_JAVA_HOME,
1028
            original = replaceAll(original, VAR_JAVA_HOME,
1026
                System.getProperty ("java.home")); // NOI18N
1029
                System.getProperty ("java.home")); // NOI18N
1027
            return original;
1030
            return original;
(-)b99d9a6cf077 (+86 lines)
Added Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2011 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.updater;
43
44
import java.io.FileOutputStream;
45
import java.io.File;
46
import java.util.Properties;
47
import org.netbeans.junit.NbTestCase;
48
49
/**
50
 *
51
 * @author Jaroslav Tulach <jtulach@netbeans.org>
52
 */
53
public class ModuleUpdaterConfigTest extends NbTestCase {
54
    private File props;
55
    private File cluster;
56
    
57
    public ModuleUpdaterConfigTest(String s) {
58
        super(s);
59
    }
60
61
    @Override
62
    protected void setUp() throws Exception {
63
        clearWorkDir();
64
        
65
        Properties p = new Properties();
66
        p.setProperty("relativeClassPath", "%FS%jarda%PS%%FS%darda%PS%%FS%parda");
67
        
68
        props = new File(getWorkDir(), "p.properties");
69
        FileOutputStream os = new FileOutputStream(props);
70
        p.store(os, "");
71
        os.close();
72
        
73
        cluster = new File(getWorkDir(), "cluster");
74
        cluster.mkdirs();
75
    }
76
    
77
    public void testMainConfigParsesPathSeparator() {
78
        ModuleUpdater.MainConfig mc = new ModuleUpdater.MainConfig(props.getPath(), cluster);
79
        String exp = File.separator + "jarda" + File.pathSeparator + File.separator + "darda" + File.pathSeparator + File.separator + "parda";
80
        if (!mc.getClasspath().contains(exp)) {
81
            fail("Expecting " + exp + " but was: " + mc.getClasspath());
82
        }
83
    }
84
85
    
86
}

Return to bug 198484