Tabnine Logo
CndFileUtils.normalizeAbsolutePath
Code IndexAdd Tabnine to your IDE (free)

How to use
normalizeAbsolutePath
method
in
org.netbeans.modules.cnd.utils.cache.CndFileUtils

Best Java code snippets using org.netbeans.modules.cnd.utils.cache.CndFileUtils.normalizeAbsolutePath (Showing top 20 results out of 315)

origin: org.netbeans.modules/org-netbeans-modules-cnd-utils

public FSPath(FileSystem fileSystem, String path) {
  this.fileSystem = fileSystem;
  this.path = CndFileUtils.normalizeAbsolutePath(fileSystem, path);
}
origin: org.netbeans.modules/org-netbeans-modules-cnd-apt

private static String normalize(FileSystem fs, String path) {
  return CndFileUtils.normalizeAbsolutePath(fs, path);
}
origin: org.netbeans.modules/org-netbeans-modules-cnd-utils

/**
 * normalize file
 * @param file
 * @return
 */
public static File normalizeFile(File file) {
  CndUtils.assertAbsoluteFileInConsole(file, "Is it OK to normalize not absolute file? [" + file + "] during this session it is [" + file.getAbsolutePath() + "] but will be different if start IDE from another folder"); //NOI18N
  String path = file.getPath();
  String normPath = normalizeAbsolutePath(file.getAbsolutePath());
  return path.equals(normPath) ? file : new File(normPath);
}
origin: org.netbeans.modules/org-netbeans-modules-cnd-highlight

private String getRightName(String fullName){
  fullName = CndFileUtils.normalizeAbsolutePath(fullName);
  fullName = fixFileName(fullName);
  return fullName;
}
origin: org.netbeans.modules/org-netbeans-modules-cnd-utils

public static void assertNormalized(FileSystem fs, CharSequence absPath) {
  if (isDebugMode()) {
    String normFile = CndFileUtils.normalizeAbsolutePath(fs, absPath.toString());
    if (!normFile.contentEquals(absPath)) {
      assertTrueInConsole(false, "Parameter file was not normalized. Was " + absPath + " instead of " + normFile); // NOI18N
    }
  }
}

origin: org.netbeans.modules/org-netbeans-modules-cnd-makeproject

private String getValidBinaryPath() {
  String path = ((EditableComboBox) binaryField).getText().trim();
  if (path.isEmpty()) {
    return null;
  }
  if (CndPathUtilities.isPathAbsolute(path)) {
    return CndFileUtils.normalizeAbsolutePath(fileSystem, path);
  } else {
    return null;
  }   
}

origin: org.netbeans.modules/org-netbeans-modules-cnd-toolchain

protected String normalizePath(String path) {
  // this call also fixes inambiguties at case insensitive systems when work
  // with case sensitive "path"s returned by remote compilers
  return CndFileUtils.normalizeAbsolutePath(FileSystemProvider.getFileSystem(getExecutionEnvironment()), path);
}
origin: org.netbeans.modules/org-netbeans-modules-cnd-utils

public static String toAbsolutePath(FileSystem fileSystem, String basePath, String path) {
  CndUtils.assertAbsolutePathInConsole(basePath);
  path = (path == null || path.length() == 0) ? "." : path; // NOI18N
  if (!isPathAbsolute(path)) {
    path = basePath + '/' + path; //NOI18N
  }       
  path = CndFileUtils.normalizeAbsolutePath(fileSystem, path);
  path = naturalizeSlashes(fileSystem, path);
  return path;
}

origin: org.netbeans.modules/org-netbeans-modules-cnd-utils

public static String normalizePath(FileObject fo) {
  try {
    return normalizeAbsolutePath(fo.getFileSystem(), fo.getPath());
  } catch (FileStateInvalidException ex) {
    Exceptions.printStackTrace(ex);
    return fo.getPath();
  }
}
origin: org.netbeans.modules/org-netbeans-modules-cnd-makeproject

private boolean validSourceRoot() {
  String path = sourcesField.getText().trim();
  if (path.isEmpty()) {
    return false;
  }
  if (CndPathUtilities.isPathAbsolute(path)) {
    FileObject fo = fileSystem.findResource(CndFileUtils.normalizeAbsolutePath(path));
    if (fo == null || !fo.isValid()) {
      return false;
    }
    return fo.isFolder();
  } else {
    return false;
  }
}
origin: org.netbeans.modules/org-netbeans-modules-cnd-modelimpl

public DefaultFileItem(NativeProject project, String absolutePath) {
  Parameters.notNull("project", project);
  Parameters.notNull("absolutePath", absolutePath);
  this.project = project;
  this.normalizedAbsPath = CndFileUtils.normalizeAbsolutePath(project.getFileSystem(), absolutePath);
}
origin: org.netbeans.modules/org-netbeans-modules-cnd-api-remote

public static String normalizeAbsolutePath(String absPath, Project project) {
  ExecutionEnvironment execEnv = getProjectSourceExecutionEnvironment(project);
  if (execEnv != null && execEnv.isRemote()) {
    return normalizeAbsolutePath(absPath, execEnv);
  } else {
    return CndFileUtils.normalizeAbsolutePath(absPath);
  }
}
origin: org.netbeans.modules/org-netbeans-modules-cnd-makeproject

  private synchronized void init() {
    if (!inited && this.projectDescriptorProvider.gotDescriptor()) {
      MakeConfigurationDescriptor cd = this.projectDescriptorProvider.getConfigurationDescriptor();
      if (cd != null) {
        Configurations confs = cd.getConfs();
        Set<String> newSet = new HashSet<>();
        for (Configuration conf : confs.getConfigurations()) {
          if (conf instanceof MakeConfiguration) {
            String outputValue = ((MakeConfiguration) conf).getOutputValue();
            if (!outputValue.isEmpty()) {
              newSet.add(CndFileUtils.normalizeAbsolutePath(((MakeConfiguration) conf).getAbsoluteOutputValue()));
            }
          }
        }
        skippedFiles = newSet;
        inited = true;
      }
    }
  }
}
origin: org.netbeans.modules/org-netbeans-modules-cnd-makeproject

/**
 *
 * @param projectName name of the project
 * @param projectFolder project folder (i.e. ~/NetbeansProjects/projectName)
 */
//XXX:fullRemote:fileSystem - change File to setFSPath
public ProjectParameters(String projectName, FSPath projectFolder) {
  this.projectName = projectName;
  this.sourceEnv = FileSystemProvider.getExecutionEnvironment(projectFolder.getFileSystem());
  this.projectFolderPath = CndFileUtils.normalizeAbsolutePath(projectFolder.getFileSystem(), projectFolder.getPath());
  this.makefile = MakeConfigurationDescriptor.DEFAULT_PROJECT_MAKFILE_NAME;
  this.configurations = new MakeConfiguration[0];
  this.openFlag = false;
  this.sourceFolders = null;
  this.sourceFoldersFilter = null;
  this.testFolders = null; 
  this.importantFileItems = null; 
  this.mainFile = "";
  this.postCreationClassName = null;
  this.mainProject = null;
  this.templateParams = Collections.<String, Object>emptyMap();
}
origin: org.netbeans.api/org-netbeans-modules-cnd-gizmo

public boolean showSource(SourceFileInfo lineInfo, boolean isReadOnly) {
  FileObject fo = CndFileUtils.toFileObject(CndFileUtils.normalizeAbsolutePath(lineInfo.getFileName()));
  try {
    new ROEditor(fo).open();
  } catch (DataObjectNotFoundException e) {
    e.printStackTrace();
    return false;
  }
  return true;
}
origin: org.netbeans.modules/org-netbeans-modules-cnd-makeproject

public static FileObject getFileObject(String path, WizardDescriptor wizardDescriptor) {
  if (isFullRemote(wizardDescriptor)) {
    String hostUID = (String) wizardDescriptor.getProperty(WizardConstants.PROPERTY_HOST_UID);
    CndUtils.assertNotNull(hostUID, "Null host UID"); //NOI18N
    ExecutionEnvironment env = ExecutionEnvironmentFactory.fromUniqueID(hostUID);
    return RemoteFileUtil.getFileObject(path, env);
  } else {
    return CndFileUtils.toFileObject(CndFileUtils.normalizeAbsolutePath(path));
  }
}
origin: org.netbeans.modules/org-netbeans-modules-cnd-makeproject

  exe = buildWorkingDirFO.getFileObject(executablePath);
} else {
  executablePath = CndFileUtils.normalizeAbsolutePath(executablePath);
  exe = RemoteFileUtil.getFileObject(
      executablePath,
origin: org.netbeans.modules/org-netbeans-modules-cnd-api-remote

/**
 * In many places, standard sequence is as follows:
 *  - convert path to absolute if need
 *  - normalize it
 *  - find file object
 * In the case of non-local file systems we should delegate it to correspondent file systems.
 */
public static FileObject getFileObject(FileObject baseFileObject, String relativeOrAbsolutePath) {
  FileObject result = FileSystemProvider.getFileObject(baseFileObject, relativeOrAbsolutePath);
  if (result == null) {
    String absRootPath = CndPathUtilities.toAbsolutePath(baseFileObject, relativeOrAbsolutePath);
    try {
      // XXX:fullRemote we use old logic for local and new for remote
      // but remote approach for local gives #197093 -  Exception: null file
      final FileSystem fs = baseFileObject.getFileSystem();
      if (CndFileUtils.isLocalFileSystem(fs)) {
        result = CndFileUtils.toFileObject(CndFileUtils.normalizeAbsolutePath(absRootPath));
      } else {
        result = InvalidFileObjectSupport.getInvalidFileObject(fs, absRootPath);
      }
    } catch (FileStateInvalidException ex) {
      Exceptions.printStackTrace(ex);
      result = InvalidFileObjectSupport.getInvalidFileObject(InvalidFileObjectSupport.getDummyFileSystem(), absRootPath);
    }
  }
  return result;
}
origin: org.netbeans.modules/org-netbeans-modules-cnd-modelimpl

private CsmFile findFileByPath(CharSequence absolutePath, boolean createIfPossible) {
  absolutePath = CndFileUtils.normalizeAbsolutePath(fileSystem, absolutePath.toString());
  APTPreprocHandler preprocHandler = null;
  if (getFileContainer().getEntry(absolutePath) == null) {
origin: org.netbeans.modules/org-netbeans-modules-cnd-makeproject

private void renameTo(String newPath) {
  Folder f = getFolder();
  String oldPath;
  if (normalizedPath != null) {
    oldPath = normalizedPath;
  } else {
    oldPath = CndFileUtils.normalizeAbsolutePath(fileSystem, getAbsPath());
  }
  Item item = f.addItem(new Item(fileSystem, newPath));
  if (item != null && item.getFolder() != null) {
    if (item.getFolder().isProjectFiles()) {
      copyItemConfigurations(this, item);
    }
    f.removeItem(this);
    f.renameItemAction(oldPath, item);
  }
}
org.netbeans.modules.cnd.utils.cacheCndFileUtilsnormalizeAbsolutePath

Javadoc

normalize LOCAL absolute paths

Popular methods of CndFileUtils

  • isLocalFileSystem
  • toFileObject
  • getLocalFileSystem
  • createLocalFile
  • normalizeFile
    normalize file
  • fileObjectToUrl
  • getFileSeparatorChar
  • isExistingFile
    Tests whether the file exists and not directory. One of file or filePath must be not null
  • normalizePath
  • urlToFileObject
  • areFilenamesEqual
  • getCanonicalFileObject
  • areFilenamesEqual,
  • getCanonicalFileObject,
  • getCanonicalPath,
  • isExistingDirectory,
  • isSystemCaseSensitive,
  • toFSPathList,
  • toFile,
  • changeStringCaseIfNeeded,
  • clearFileExistenceCache

Popular in Java

  • Creating JSON documents from java classes using gson
  • getContentResolver (Context)
  • compareTo (BigDecimal)
  • getSupportFragmentManager (FragmentActivity)
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • ImageIO (javax.imageio)
  • Option (scala)
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now