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


Java PathUtil.toSystemIndependentName方法代码示例

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


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

示例1: getSdkDownloadUrl

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
/**
 * @return Android SDK download URL
 */
@NotNull
public static String getSdkDownloadUrl() {
  String url = System.getProperty("android.sdkurl");
  if (!StringUtil.isEmptyOrSpaces(url)) {
    File file = new File(url);
    if (file.isFile()) {
      // Can't use any path => URL utilities as they don't add two slashes
      // after the protocol as required by IJ downloader
      return LocalFileSystem.PROTOCOL_PREFIX + PathUtil.toSystemIndependentName(file.getAbsolutePath());
    }
    else {
      System.err.println("File " + file.getAbsolutePath() + " does not exist.");
    }
  }
  String downloadUrl = AndroidSdkUtils.getSdkDownloadUrl();
  if (downloadUrl == null) {
    throw new IllegalStateException("Unsupported OS");
  }
  return downloadUrl;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:FirstRunWizardDefaults.java

示例2: createProjectWithSubprojects

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@NotNull
private VirtualFile createProjectWithSubprojects(Map<String, String> modules, String... nonExistingReferencedModules) throws IOException {
  Collection<String> customLocationStatements = new LinkedList<String>();

  for (Map.Entry<String, String> module : modules.entrySet()) {
    String path = module.getValue();
    if (Strings.isNullOrEmpty(path)) {
      path = PathUtil.toSystemIndependentName(GradleUtil.getDefaultPhysicalPathFromGradlePath(module.getKey()));
    }
    else {
      customLocationStatements.add(String.format("project('%s').projectDir = new File('%s')", module.getKey(), path));
    }
    createGradleProjectToImport(dir, path);
  }
  Iterable<String> allModules =
    Iterables.concat(modules.keySet(), Iterables.transform(Arrays.asList(nonExistingReferencedModules), pathToModuleName));
  return configureTopLevelProject(dir, allModules, customLocationStatements);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:GradleModuleImportTest.java

示例3: getFilePath

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@NotNull
public final String getFilePath() {
    String chosenExtension = this.getExtension();
    String filename = PathUtil.toSystemIndependentName(this.getFileName());
    String extension = PhpNameUtil.getExtension(filename);
    String fullFileName = chosenExtension.equals(extension)?filename:PhpNameUtil.getFullFileName(filename, chosenExtension);
    String relativePath = this.myDirectoryCombobox.getRelativePath();
    return StringUtil.isEmpty(relativePath)?fullFileName:relativePath + "/" + StringUtil.trimEnd(fullFileName, "/");
}
 
开发者ID:aurimasniekis,项目名称:idea-php-class-templates,代码行数:10,代码来源:PhpNewClassDialog.java

示例4: getStatus

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
private FilePatchStatus getStatus(final T patch) {
  final String beforeName = PathUtil.toSystemIndependentName(patch.getBeforeName());
  final String afterName = PathUtil.toSystemIndependentName(patch.getAfterName());

  if (patch.isNewFile() || (beforeName == null)) {
    return FilePatchStatus.ADDED;
  }
  else if (patch.isDeletedFile() || (afterName == null)) {
    return FilePatchStatus.DELETED;
  }

  if (beforeName.equals(afterName)) return FilePatchStatus.MODIFIED;
  return FilePatchStatus.MOVED_OR_RENAMED;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:AbstractFilePatchInProgress.java

示例5: StripCapablePath

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
private StripCapablePath(final String path) {
  final String corrected = PathUtil.toSystemIndependentName(path.trim());
  mySourcePath = new StringBuilder(corrected);
  final String[] steps = corrected.split("/");
  myStripMax = steps.length - 1;
  myParts = new int[steps.length];
  int pos = 0;
  for (int i = 0; i < steps.length; i++) {
    final String step = steps[i];
    myParts[i] = pos;
    pos += step.length() + 1; // plus 1 for separator
  }
  myCurrentStrip = 0;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:AbstractFilePatchInProgress.java

示例6: readSourcePath

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@Nullable
private static String readSourcePath(JsonReaderEx reader) {
  return PathUtil.toSystemIndependentName(StringUtil.nullize(reader.nextString().trim()));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:SourceMapDecoder.java

示例7: setProfilesIniPath

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
public void setProfilesIniPath(@Nullable String value) {
  myProfilesIniPath = PathUtil.toSystemIndependentName(StringUtil.nullize(value));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:FirefoxSettings.java

示例8: getConfiguredProfileIniPath

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@Nullable
private String getConfiguredProfileIniPath() {
  String path = PathUtil.toSystemIndependentName(StringUtil.nullize(myProfilesIniPathField.getText()));
  return myDefaultProfilesIniPath.equals(path) ? null : path;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:FirefoxSettingsConfigurable.java

示例9: setUserDataDirectoryPath

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
public void setUserDataDirectoryPath(@Nullable String value) {
  myUserDataDirectoryPath = PathUtil.toSystemIndependentName(StringUtil.nullize(value));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ChromeSettings.java

示例10: setPath

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
public void setPath(@Nullable String value) {
  path = PathUtil.toSystemIndependentName(StringUtil.nullize(value));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ConfigurableWebBrowser.java


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