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

(-)a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/MakeProjectGeneratorImpl.java (-2 / +9 lines)
Lines 80-85 Link Here
80
import org.w3c.dom.Element;
80
import org.w3c.dom.Element;
81
import org.netbeans.modules.cnd.makeproject.api.ProjectGenerator.ProjectParameters;
81
import org.netbeans.modules.cnd.makeproject.api.ProjectGenerator.ProjectParameters;
82
import org.netbeans.modules.cnd.makeproject.api.ProjectSupport;
82
import org.netbeans.modules.cnd.makeproject.api.ProjectSupport;
83
import org.netbeans.modules.cnd.makeproject.ui.wizards.MakeSampleProjectGenerator;
83
import org.netbeans.modules.cnd.spi.remote.RemoteSyncFactory;
84
import org.netbeans.modules.cnd.spi.remote.RemoteSyncFactory;
84
import org.netbeans.modules.cnd.utils.CndPathUtilitities;
85
import org.netbeans.modules.cnd.utils.CndPathUtilitities;
85
import org.netbeans.modules.cnd.utils.CndUtils;
86
import org.netbeans.modules.cnd.utils.CndUtils;
Lines 108-114 Link Here
108
109
109
    public static String getDefaultProjectFolder(ExecutionEnvironment env) {
110
    public static String getDefaultProjectFolder(ExecutionEnvironment env) {
110
        try {
111
        try {
111
            return HostInfoUtils.getHostInfo(env).getUserDir() + '/' + ProjectChooser.getProjectsFolder().getName();  //NOI18N
112
            if (env.isLocal()) {
113
                return getDefaultProjectFolder();
114
            } else {
115
                return HostInfoUtils.getHostInfo(env).getUserDir() + '/' + ProjectChooser.getProjectsFolder().getName();  //NOI18N
116
            }
112
        } catch (IOException ex) {
117
        } catch (IOException ex) {
113
            ex.printStackTrace(System.err); // it doesn't make sense to disturb user
118
            ex.printStackTrace(System.err); // it doesn't make sense to disturb user
114
        } catch (CancellationException ex) {
119
        } catch (CancellationException ex) {
Lines 345-351 Link Here
345
    }
350
    }
346
351
347
    private static FileObject createProjectDir(ProjectParameters prjParams) throws IOException {
352
    private static FileObject createProjectDir(ProjectParameters prjParams) throws IOException {
348
        FileObject dirFO = FileUtil.createFolder(prjParams.getSourceFileSystem().getRoot(), prjParams.getProjectFolderPath());
353
        String projectFolderPath = prjParams.getProjectFolderPath();
354
        MakeSampleProjectGenerator.workAroundBug203507(projectFolderPath);
355
        FileObject dirFO = FileUtil.createFolder(prjParams.getSourceFileSystem().getRoot(), projectFolderPath);
349
        //File dir = prjParams.getProjectFolder();
356
        //File dir = prjParams.getProjectFolder();
350
        //if (!dir.exists()) {
357
        //if (!dir.exists()) {
351
        //    //Refresh before mkdir not to depend on window focus
358
        //    //Refresh before mkdir not to depend on window focus
(-)a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/ProjectActionSupport.java (-1 / +5 lines)
Lines 714-720 Link Here
714
                    runDir = runDir.trim();
714
                    runDir = runDir.trim();
715
                    if (runDir.startsWith("~/") || runDir.startsWith("~\\") || runDir.equals("~")) { // NOI18N
715
                    if (runDir.startsWith("~/") || runDir.startsWith("~\\") || runDir.equals("~")) { // NOI18N
716
                        try {
716
                        try {
717
                            runDir = HostInfoUtils.getHostInfo(pae.getConfiguration().getDevelopmentHost().getExecutionEnvironment()).getUserDir() + runDir.substring(1);
717
                            if (pae.getConfiguration().getDevelopmentHost().getExecutionEnvironment().isLocal()) {
718
                                runDir = HostInfoUtils.getHostInfo(pae.getConfiguration().getDevelopmentHost().getExecutionEnvironment()).getUserDirFile().getAbsolutePath() + runDir.substring(1);
719
                            } else {
720
                                runDir = HostInfoUtils.getHostInfo(pae.getConfiguration().getDevelopmentHost().getExecutionEnvironment()).getUserDir() + runDir.substring(1);
721
                            }
718
                        } catch (IOException ex) {
722
                        } catch (IOException ex) {
719
                            Logger.getLogger(ProjectActionSupport.class.getName()).log(Level.INFO, "", ex);  // NOI18N
723
                            Logger.getLogger(ProjectActionSupport.class.getName()).log(Level.INFO, "", ex);  // NOI18N
720
                        } catch (CancellationException ex) {
724
                        } catch (CancellationException ex) {
(-)a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/runprofiles/RunProfile.java (-1 / +5 lines)
Lines 539-545 Link Here
539
        runDir2 = runDir2.trim();
539
        runDir2 = runDir2.trim();
540
        if (makeConfiguration != null && (runDir2.startsWith("~/") || runDir2.startsWith("~\\") || runDir2.equals("~"))) { // NOI18N
540
        if (makeConfiguration != null && (runDir2.startsWith("~/") || runDir2.startsWith("~\\") || runDir2.equals("~"))) { // NOI18N
541
            try {
541
            try {
542
                runDir2 = HostInfoUtils.getHostInfo(makeConfiguration.getDevelopmentHost().getExecutionEnvironment()).getUserDir() + runDir2.substring(1);
542
                if (makeConfiguration.getDevelopmentHost().getExecutionEnvironment().isLocal()) {
543
                    runDir2 = HostInfoUtils.getHostInfo(makeConfiguration.getDevelopmentHost().getExecutionEnvironment()).getUserDirFile().getAbsolutePath() + runDir2.substring(1);
544
                } else {
545
                    runDir2 = HostInfoUtils.getHostInfo(makeConfiguration.getDevelopmentHost().getExecutionEnvironment()).getUserDir() + runDir2.substring(1);
546
                }
543
            } catch (IOException ex) {
547
            } catch (IOException ex) {
544
                Logger.getLogger(RunProfile.class.getName()).log(Level.INFO, "", ex);  // NOI18N
548
                Logger.getLogger(RunProfile.class.getName()).log(Level.INFO, "", ex);  // NOI18N
545
            } catch (CancellationException ex) {
549
            } catch (CancellationException ex) {
(-)a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/wizards/MakeSampleProjectGenerator.java (-2 / +22 lines)
Lines 45-55 Link Here
45
45
46
import java.io.BufferedReader;
46
import java.io.BufferedReader;
47
import java.io.BufferedWriter;
47
import java.io.BufferedWriter;
48
import java.io.File;
48
import java.io.IOException;
49
import java.io.IOException;
49
import java.io.InputStream;
50
import java.io.InputStream;
50
import java.io.InputStreamReader;
51
import java.io.InputStreamReader;
51
import java.io.OutputStream;
52
import java.io.OutputStream;
52
import java.io.OutputStreamWriter;
53
import java.io.OutputStreamWriter;
54
import java.net.URL;
53
import java.util.ArrayList;
55
import java.util.ArrayList;
54
import java.util.Collection;
56
import java.util.Collection;
55
import java.util.Collections;
57
import java.util.Collections;
Lines 80-85 Link Here
80
import org.openide.filesystems.FileLock;
82
import org.openide.filesystems.FileLock;
81
import org.openide.filesystems.FileObject;
83
import org.openide.filesystems.FileObject;
82
import org.openide.filesystems.FileUtil;
84
import org.openide.filesystems.FileUtil;
85
import org.openide.filesystems.URLMapper;
83
import org.openide.loaders.DataObject;
86
import org.openide.loaders.DataObject;
84
import org.openide.util.Lookup;
87
import org.openide.util.Lookup;
85
import org.openide.xml.XMLUtil;
88
import org.openide.xml.XMLUtil;
Lines 117-123 Link Here
117
            prjParams.setPostCreationClassName(postCreationClassName);
120
            prjParams.setPostCreationClassName(postCreationClassName);
118
        }
121
        }
119
        if (mainProject != null) {
122
        if (mainProject != null) {
120
            FileObject parentFolderLocation = FileUtil.createFolder(prjParams.getSourceFileSystem().getRoot(), prjParams.getProjectFolderPath());
123
            final String projectFolderPath = prjParams.getProjectFolderPath();
124
            workAroundBug203507(projectFolderPath);
125
            FileObject parentFolderLocation = FileUtil.createFolder(prjParams.getSourceFileSystem().getRoot(), projectFolderPath);
121
            FileObject mainProjectLocation;
126
            FileObject mainProjectLocation;
122
            if (mainProject.equals(".")) { // NOI18N
127
            if (mainProject.equals(".")) { // NOI18N
123
                mainProjectLocation = parentFolderLocation;
128
                mainProjectLocation = parentFolderLocation;
Lines 343-350 Link Here
343
                "APPLICATION", flavor, family, host, platform, "SAMPLE_PROJECT"); //NOI18N
348
                "APPLICATION", flavor, family, host, platform, "SAMPLE_PROJECT"); //NOI18N
344
    }
349
    }
345
350
351
    public static void workAroundBug203507(String projectFolderPath) {
352
        if (projectFolderPath.length()>1 && projectFolderPath.charAt(1) == ':') {
353
            // This is ugly work around Bug #203507
354
            try {
355
                File driver = new File(projectFolderPath.substring(0,2));
356
                URL url = driver.toURI().toURL();
357
                /*FileObject driverFO =*/ URLMapper.findFileObject(url);
358
            } catch (Throwable e) {
359
            }
360
        }
361
        
362
    }
363
    
346
    public static Set<DataObject> createProjectFromTemplate(InputStream inputStream, ProjectGenerator.ProjectParameters prjParams) throws IOException {
364
    public static Set<DataObject> createProjectFromTemplate(InputStream inputStream, ProjectGenerator.ProjectParameters prjParams) throws IOException {
347
        FileObject prjLoc = FileUtil.createFolder(prjParams.getSourceFileSystem().getRoot(), prjParams.getProjectFolderPath());
365
        String projectFolderPath = prjParams.getProjectFolderPath();
366
        workAroundBug203507(projectFolderPath);
367
        FileObject prjLoc = FileUtil.createFolder(prjParams.getSourceFileSystem().getRoot(), projectFolderPath);
348
        unzip(inputStream, prjLoc);
368
        unzip(inputStream, prjLoc);
349
        postProcessProject(prjLoc, prjParams.getProjectName(), prjParams);
369
        postProcessProject(prjLoc, prjParams.getProjectName(), prjParams);
350
        customPostProcessProject(prjLoc, prjParams.getProjectName(), prjParams);
370
        customPostProcessProject(prjLoc, prjParams.getProjectName(), prjParams);
(-)a/cnd.remote/src/org/netbeans/modules/remote/ui/OpenTerminalAction.java (-1 / +6 lines)
Lines 233-239 Link Here
233
        try {
233
        try {
234
            HostInfo hostInfo = HostInfoUtils.getHostInfo(env);
234
            HostInfo hostInfo = HostInfoUtils.getHostInfo(env);
235
            if (hostInfo != null) {
235
            if (hostInfo != null) {
236
                String userDir = hostInfo.getUserDir();
236
                String userDir;
237
                if (env.isLocal()) {
238
                    userDir = hostInfo.getUserDirFile().getAbsolutePath();
239
                } else {
240
                    userDir = hostInfo.getUserDir();
241
                }
237
                return userDir;
242
                return userDir;
238
            }
243
            }
239
        } catch (IOException ex) {
244
        } catch (IOException ex) {

Return to bug 203507