当前位置: 首页>>代码示例>>Java>>正文


Java PathUtil.getCanonicalPath方法代码示例

本文整理汇总了Java中com.intellij.util.PathUtil.getCanonicalPath方法的典型用法代码示例。如果您正苦于以下问题:Java PathUtil.getCanonicalPath方法的具体用法?Java PathUtil.getCanonicalPath怎么用?Java PathUtil.getCanonicalPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.util.PathUtil的用法示例。


在下文中一共展示了PathUtil.getCanonicalPath方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doBuildChildren

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@NotNull
@Override
protected List<? extends ExternalSystemNode> doBuildChildren() {
  List<ExternalSystemNode> runConfigurationNodes = ContainerUtil.newArrayList();
  final AbstractExternalSystemTaskConfigurationType configurationType = ExternalSystemUtil.findConfigurationType(myModuleData.getOwner());
  if (configurationType == null) return Collections.emptyList();

  Set<RunnerAndConfigurationSettings> settings = new THashSet<RunnerAndConfigurationSettings>(
    RunManager.getInstance(myProject).getConfigurationSettingsList(configurationType));


  String directory = PathUtil.getCanonicalPath(myModuleData.getLinkedExternalProjectPath());

  for (RunnerAndConfigurationSettings cfg : settings) {
    ExternalSystemRunConfiguration externalSystemRunConfiguration = (ExternalSystemRunConfiguration)cfg.getConfiguration();

    if (directory.equals(PathUtil.getCanonicalPath(externalSystemRunConfiguration.getSettings().getExternalProjectPath()))) {
      runConfigurationNodes.add(new RunConfigurationNode(getExternalProjectsView(), this, cfg));
    }
  }

  return runConfigurationNodes;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:RunConfigurationsNode.java

示例2: getCanonicalFile

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@Nullable
protected File getCanonicalFile(final String path) {
  if (path == null) {
    return null;
  }
  try {
    final File file = new File(path);
    if (file.isAbsolute()) {
      return file.getCanonicalFile();
    }
    final String baseDir = getContextAntProject().getProjectBasedirPath();
    if (baseDir == null) {
      return null;
    }
    return new File(PathUtil.getCanonicalPath(new File(baseDir, path).getPath()));
  }
  catch (IOException e) {
    return null;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:AntDomFilesProviderImpl.java

示例3: parseItem

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@Nullable
@Override
protected DirectoryEntry parseItem(ProjectViewParser parser, ParseContext parseContext) {
  String text = parseContext.current().text;
  boolean excluded = text.startsWith("-");
  text = excluded ? text.substring(1) : text;

  text = PathUtil.getCanonicalPath(text);

  String error = WorkspacePath.validate(text);
  if (error != null) {
    parseContext.addError(error);
    return null;
  }
  return new DirectoryEntry(new WorkspacePath(text), !excluded);
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:17,代码来源:DirectorySection.java

示例4: toAbsolutePath

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@Nullable
private String toAbsolutePath(String genRelativePath) {
  if (genRelativePath == null) {
    return null;
  }
  if (genRelativePath.length() == 0) {
    return "";
  }
  String moduleDirPath = AndroidRootUtil.getModuleDirPath(myContext.getModule());
  if (moduleDirPath == null) return null;
  final String path = PathUtil.getCanonicalPath(new File(moduleDirPath, genRelativePath).getPath());
  return path != null ? PathUtil.getLocalPath(path) : null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:AndroidFacetEditorTab.java

示例5: getCacheDir

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@Override
@Nullable
public File getCacheDir(boolean create) {
  final String path = ourSystemPath != null ? ourSystemPath : (ourSystemPath = PathUtil.getCanonicalPath(PathManager.getSystemPath()));
  File lint = new File(path, "lint");
  if (create && !lint.exists()) {
    lint.mkdirs();
  }
  return lint;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:IntellijLintClient.java

示例6: updateRunConfigurations

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
public void updateRunConfigurations(MavenProject mavenProject) {
  boolean childChanged = false;

  Set<RunnerAndConfigurationSettings> settings = new THashSet<RunnerAndConfigurationSettings>(
    RunManager.getInstance(myProject).getConfigurationSettingsList(MavenRunConfigurationType.getInstance()));

  for (Iterator<RunConfigurationNode> itr = myChildren.iterator(); itr.hasNext(); ) {
    RunConfigurationNode node = itr.next();

    if (settings.remove(node.getSettings())) {
      node.updateRunConfiguration();
    }
    else {
      itr.remove();
      childChanged = true;
    }
  }

  String directory = PathUtil.getCanonicalPath(mavenProject.getDirectory());

  int oldSize = myChildren.size();

  for (RunnerAndConfigurationSettings cfg : settings) {
    MavenRunConfiguration mavenRunConfiguration = (MavenRunConfiguration)cfg.getConfiguration();

    if (directory.equals(PathUtil.getCanonicalPath(mavenRunConfiguration.getRunnerParameters().getWorkingDirPath()))) {
      myChildren.add(new RunConfigurationNode(this, cfg));
    }
  }

  if (oldSize != myChildren.size()) {
    childChanged = true;
    sort(myChildren);
  }

  if (childChanged) {
    childrenChanged();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:40,代码来源:MavenProjectsStructure.java

示例7: parseItem

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@Nullable
@Override
protected GenfilesPath parseItem(ProjectViewParser parser, ParseContext parseContext) {
  String canonicalPath = PathUtil.getCanonicalPath(parseContext.current().text);

  List<BlazeValidationError> errors = new ArrayList<>();
  if (!GenfilesPath.validate(canonicalPath, errors)) {
    parseContext.addErrors(errors);
    return null;
  }
  return new GenfilesPath(canonicalPath);
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:13,代码来源:GeneratedAndroidResourcesSection.java

示例8: getCompilerSystemDirectory

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
public static File getCompilerSystemDirectory() {
  //noinspection HardCodedStringLiteral
  final String systemPath = ourSystemPath != null? ourSystemPath : (ourSystemPath = PathUtil.getCanonicalPath(PathManager.getSystemPath()));
  return new File(systemPath, "compiler");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:CompilerPaths.java

示例9: getAbsolutePath

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
private static String getAbsolutePath(String path) {
  path = VfsUtil.urlToPath(path);
  path = PathUtil.getCanonicalPath(path);
  return FileUtil.toSystemIndependentName(path);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ExternalSystemImportingTestCase.java

示例10: localPathForRemoteRoot

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
public static String localPathForRemoteRoot(@NotNull String sourcesLocalPath, @NotNull String remoteRoot) {
  return
    PathUtil.getCanonicalPath(new File(sourcesLocalPath, generateRootFolderNameFor(remoteRoot)).getAbsolutePath());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:PyRemoteSourceItem.java

示例11: getThumbnailCacheDir

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
private static File getThumbnailCacheDir() {
  final String path = ourSystemPath != null ? ourSystemPath : (ourSystemPath = PathUtil.getCanonicalPath(PathManager.getSystemPath()));
  //noinspection HardCodedStringLiteral
  return new File(path, "android-devices" + File.separator + "v3");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:DeviceArtPainter.java

示例12: getNormalizedPath

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@Nullable
private static String getNormalizedPath(@NotNull File settingsFile) {
  String canonized = PathUtil.getCanonicalPath(settingsFile.getAbsolutePath());
  return canonized == null ? null : FileUtil.toSystemIndependentName(canonized);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:MavenProjectsManagerWatcher.java

示例13: Path

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
public Path(@NotNull String path) {
  path = PathUtil.getCanonicalPath(path);
  path = FileUtil.toSystemIndependentName(path);
  this.path = path;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:Path.java

示例14: createModulePom

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
private VirtualFile createModulePom() throws IOException {
  VirtualFile baseDir = myVirtualFile.getParent();
  String modulePath = PathUtil.getCanonicalPath(baseDir.getPath() + "/" + myText);
  VirtualFile moduleDir = VfsUtil.createDirectories(modulePath);
  return moduleDir.createChildData(this, MavenConstants.POM_XML);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:MavenModulePsiReference.java


注:本文中的com.intellij.util.PathUtil.getCanonicalPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。