@Override public FileSystem getFileSystem() { return CndFileUtils.getLocalFileSystem(); }
public static boolean isLocalFileSystem(FileSystem fs) { return fs == getLocalFileSystem(); }
private String preparePath(String path) { String absPath = changeStringCaseIfNeeded(getLocalFileSystem(), path); if (isWindows) { absPath = absPath.replace('/', '\\'); } return absPath; }
public static boolean isLocalFileSystem(FileObject fo) { try { return fo.getFileSystem() == getLocalFileSystem(); } catch (FileStateInvalidException ex) { return false; } }
@Override public FileSystem getFileSystem() { try { return projectRoot.getFileSystem(); } catch (FileStateInvalidException ex) { Exceptions.printStackTrace(ex); return CndFileUtils.getLocalFileSystem(); } }
private static FileSystem getFileSystem(FileObject fo) { try { return fo.getFileSystem(); } catch (FileStateInvalidException ex) { Exceptions.printStackTrace(ex); return CndFileUtils.getLocalFileSystem(); } }
@Override public List<FSPath> getSystemIncludePaths() { return CndFileUtils.toFSPathList(CndFileUtils.getLocalFileSystem(), this.sysIncludes); }
@Override public List<FSPath> getUserIncludePaths() { return CndFileUtils.toFSPathList(CndFileUtils.getLocalFileSystem(), this.usrIncludes); }
public static boolean exists(File file) { return getFlags(getLocalFileSystem(), file.getAbsolutePath(), true).exist; }
public ProjectParameters(String projectName, File projectFolder) { this(projectName, new FSPath(CndFileUtils.getLocalFileSystem(), projectFolder.getAbsolutePath())); }
public static boolean isExistingFile(String filePath) { return isExistingFile(getLocalFileSystem(), filePath); }
private void cleanCachesImpl(String file) { String absPath = preparePath(file); Flags removed = getFilesMap(getLocalFileSystem()).remove(absPath); if (TRACE_EXTERNAL_CHANGES) { System.err.printf("clean cache for %s->%s\n", absPath, removed); } invalidateFile(file, absPath); } }
@Override public java.awt.Component getCustomEditor() { FileSystem fs = (makeConfiguration == null) ? CndFileUtils.getLocalFileSystem() : makeConfiguration.getSourceFileSystem(); return new DirectoryChooserPanel(seed, this, propenv, fs); }
public ReferencesIndexKey() { super(KeyUtilities.getUnitId(new UnitDescriptor(UNIT_NAME, CndFileUtils.getLocalFileSystem()))); // TODO: ??? // KeyUtilities.getFileIdByName(getUnitId(), "ReferencesIndexKey$$"); // NOI18N }
@Override public void fileFolderCreated(FileEvent fe) { File file = CndFileUtils.toFile(fe.getFile()); String path = file.getAbsolutePath(); String absPath = preparePath(path); if (getFilesMap(getLocalFileSystem()).put(absPath, Flags.DIRECTORY) != null) { // If there was something in the map already - invalidate it invalidateFile(path, absPath); } }
@Override public void fileDataCreated(FileEvent fe) { File file = CndFileUtils.toFile(fe.getFile()); String path = file.getAbsolutePath(); String absPath = preparePath(path); if (getFilesMap(getLocalFileSystem()).put(absPath, Flags.FILE) != null) { // If there was something in the map already - invalidate it invalidateFile(path, absPath); } }
public static FileSystem getSourceFileSystem(NativeDebugger debugger) { if (debugger != null) { NativeDebuggerInfo ndi = debugger.getNDI(); if (ndi != null) { Configuration conf = ndi.getConfiguration(); if (conf instanceof MakeConfiguration) { return ((MakeConfiguration)conf).getSourceFileSystem(); } } } return CndFileUtils.getLocalFileSystem(); }
/** * Will create the configuration of type MakeConfiguration.TYPE_MAKEFILE, the configuration will be saved on the local machine * and will be created for default Build Host, which is returned by {@link #org.netbeans.modules.cnd.makeproject.configurations.CppUtils.getDefaultDevelopmentHost()} method * For full remote project should use {@link #createMakefileConfiguration(FSPath, String, String)} * @param baseDir path to the folder the configuration will be saved in * @param name the name of the configuration * @return the MakeConfiguration */ public static MakeConfiguration createDefaultHostMakefileConfiguration(String baseDir, String name) { return new MakeConfiguration(new FSPath(CndFileUtils.getLocalFileSystem(), baseDir), name, MakeConfiguration.TYPE_MAKEFILE, null, null); }
@Override public FileObject getFileObject() { ProjectBase csmProject = _getProject(); FileSystem fs = (csmProject == null) ? CndFileUtils.getLocalFileSystem() : csmProject.getFileSystem(); return InvalidFileObjectSupport.getInvalidFileObject(fs, getAbsolutePath()); }
private void testLibProject() { LibProjectImpl libProject = LibProjectImpl.createInstance(getModel(), CndFileUtils.getLocalFileSystem(), "/usr/include", -1); // NOI18N getModel().testAddProject(libProject); CsmCacheManager.enter(); try { tracer.dumpModel(libProject); } finally { CsmCacheManager.leave(); } }