Lines 95-104
Link Here
|
95 |
import org.netbeans.modules.cnd.utils.MIMEExtensions; |
95 |
import org.netbeans.modules.cnd.utils.MIMEExtensions; |
96 |
import org.netbeans.modules.cnd.utils.cache.CndFileUtils; |
96 |
import org.netbeans.modules.cnd.utils.cache.CndFileUtils; |
97 |
import org.netbeans.modules.cnd.utils.ui.ModalMessageDlg; |
97 |
import org.netbeans.modules.cnd.utils.ui.ModalMessageDlg; |
|
|
98 |
import org.netbeans.modules.remote.spi.FileSystemProvider; |
98 |
import org.netbeans.spi.project.support.ant.AntProjectHelper; |
99 |
import org.netbeans.spi.project.support.ant.AntProjectHelper; |
99 |
import org.openide.DialogDisplayer; |
100 |
import org.openide.DialogDisplayer; |
100 |
import org.openide.NotifyDescriptor; |
101 |
import org.openide.NotifyDescriptor; |
101 |
import org.openide.filesystems.FileObject; |
102 |
import org.openide.filesystems.FileObject; |
|
|
103 |
import org.openide.filesystems.FileStateInvalidException; |
104 |
import org.openide.filesystems.FileSystem; |
102 |
import org.openide.filesystems.FileUtil; |
105 |
import org.openide.filesystems.FileUtil; |
103 |
import org.openide.util.Exceptions; |
106 |
import org.openide.util.Exceptions; |
104 |
import org.openide.util.ImageUtilities; |
107 |
import org.openide.util.ImageUtilities; |
Lines 133-138
Link Here
|
133 |
* For any other project they are the same |
136 |
* For any other project they are the same |
134 |
*/ |
137 |
*/ |
135 |
private final FileObject baseDirFO; |
138 |
private final FileObject baseDirFO; |
|
|
139 |
private final FileSystem baseDirFS; |
136 |
private final FileObject projectDirFO; |
140 |
private final FileObject projectDirFO; |
137 |
|
141 |
|
138 |
private boolean modified = false; |
142 |
private boolean modified = false; |
Lines 159-164
Link Here
|
159 |
Parameters.notNull("projectDirFO", projectDirFO); |
163 |
Parameters.notNull("projectDirFO", projectDirFO); |
160 |
Parameters.notNull("baseDirFO", baseDirFO); |
164 |
Parameters.notNull("baseDirFO", baseDirFO); |
161 |
this.baseDirFO = baseDirFO; |
165 |
this.baseDirFO = baseDirFO; |
|
|
166 |
try { |
167 |
baseDirFS = baseDirFO.getFileSystem(); |
168 |
} catch (FileStateInvalidException ex) { |
169 |
throw new IllegalStateException("Exception when getting file system for project folder object", ex); //NOI18N |
170 |
} |
162 |
this.projectDirFO = projectDirFO; |
171 |
this.projectDirFO = projectDirFO; |
163 |
rootFolder = new Folder(this, null, "root", "root", true, Folder.Kind.ROOT); // NOI18N |
172 |
rootFolder = new Folder(this, null, "root", "root", true, Folder.Kind.ROOT); // NOI18N |
164 |
projectItems = new ConcurrentHashMap<String, Item>(); |
173 |
projectItems = new ConcurrentHashMap<String, Item>(); |
Lines 1105-1114
Link Here
|
1105 |
* Don't add if root is subdir of existing root |
1114 |
* Don't add if root is subdir of existing root |
1106 |
*/ |
1115 |
*/ |
1107 |
public void addSourceRoot(String path) { |
1116 |
public void addSourceRoot(String path) { |
1108 |
String absPath = CndPathUtilitities.toAbsolutePath(getBaseDir(), path); |
1117 |
String absPath = CndPathUtilitities.toAbsolutePath(getBaseDirFileObject(), path); |
1109 |
String canonicalPath = null; |
1118 |
String canonicalPath = null; |
1110 |
try { |
1119 |
try { |
1111 |
canonicalPath = new File(absPath).getCanonicalPath(); |
1120 |
canonicalPath = FileSystemProvider.getCanonicalPath(baseDirFS, absPath); |
1112 |
} catch (IOException ioe) { |
1121 |
} catch (IOException ioe) { |
1113 |
canonicalPath = null; |
1122 |
canonicalPath = null; |
1114 |
} |
1123 |
} |