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


Java FileUtil.resolveShortWindowsName方法代码示例

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


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

示例1: updateLastProjectLocation

import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
public static void updateLastProjectLocation(final String projectFilePath) {
  File lastProjectLocation = new File(projectFilePath);
  if (lastProjectLocation.isFile()) {
    lastProjectLocation = lastProjectLocation.getParentFile(); // for directory-based project storage
  }
  if (lastProjectLocation == null) { // the immediate parent of the ipr file
    return;
  }
  lastProjectLocation = lastProjectLocation.getParentFile(); // the candidate directory to be saved
  if (lastProjectLocation == null) {
    return;
  }
  String path = lastProjectLocation.getPath();
  try {
    path = FileUtil.resolveShortWindowsName(path);
  }
  catch (IOException e) {
    LOG.info(e);
    return;
  }
  RecentProjectsManager.getInstance().setLastProjectCreationLocation(path.replace(File.separatorChar, '/'));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:ProjectUtil.java

示例2: setContentEntryPath

import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
@Override
public void setContentEntryPath(String moduleRootPath) {
  final String path = acceptParameter(moduleRootPath);
  if (path != null) {
    try {
      myContentEntryPath = FileUtil.resolveShortWindowsName(path);
    }
    catch (IOException e) {
      myContentEntryPath = path;
    }
  }
  else {
    myContentEntryPath = null;
  }
  if (myContentEntryPath != null) {
    myContentEntryPath = myContentEntryPath.replace(File.separatorChar, '/');
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:ModuleBuilder.java

示例3: getUrl

import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
public static String getUrl(@NonNls String path) {
  try {
    path = FileUtil.resolveShortWindowsName(path);
  }
  catch (IOException ignored) { }
  return VfsUtilCore.pathToUrl(FileUtil.toSystemIndependentName(path));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ProjectOpenProcessorBase.java

示例4: getCanonicalDir

import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
private static File getCanonicalDir(File baseDir) {
  try {
    return new File(FileUtil.resolveShortWindowsName(baseDir.getAbsolutePath()));
  }
  catch (IOException e) {
    LOG.info(e);
    return baseDir;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:RootDetectionProcessor.java

示例5: resolveShortWindowsName

import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
@NotNull
private String resolveShortWindowsName(@NotNull String filePath) {
  try {
    return FileUtil.resolveShortWindowsName(filePath);
  }
  catch (IOException ignored) {
    return filePath;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ModuleManagerImpl.java

示例6: toCanonicalName

import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
@NotNull
private static String toCanonicalName(@NotNull final String filePath) {
  try {
    return FileUtil.resolveShortWindowsName(filePath);
  }
  catch (IOException e) {
    // OK. File does not yet exist so it's canonical path will be equal to its original path.
  }

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

示例7: setupRootModel

import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
public void setupRootModel(ModifiableRootModel rootModel) throws ConfigurationException {
  final CompilerModuleExtension compilerModuleExtension = rootModel.getModuleExtension(CompilerModuleExtension.class);
  compilerModuleExtension.setExcludeOutput(true);
  if (myJdk != null){
    rootModel.setSdk(myJdk);
  } else {
    rootModel.inheritSdk();
  }

  ContentEntry contentEntry = doAddContentEntry(rootModel);
  if (contentEntry != null) {
    final List<Pair<String,String>> sourcePaths = getSourcePaths();

    if (sourcePaths != null) {
      for (final Pair<String, String> sourcePath : sourcePaths) {
        String first = sourcePath.first;
        new File(first).mkdirs();
        final VirtualFile sourceRoot = LocalFileSystem.getInstance()
          .refreshAndFindFileByPath(FileUtil.toSystemIndependentName(first));
        if (sourceRoot != null) {
          contentEntry.addSourceFolder(sourceRoot, false, sourcePath.second);
        }
      }
    }
  }

  if (myCompilerOutputPath != null) {
    // should set only absolute paths
    String canonicalPath;
    try {
      canonicalPath = FileUtil.resolveShortWindowsName(myCompilerOutputPath);
    }
    catch (IOException e) {
      canonicalPath = myCompilerOutputPath;
    }
    compilerModuleExtension
      .setCompilerOutputPath(VfsUtilCore.pathToUrl(FileUtil.toSystemIndependentName(canonicalPath)));
  }
  else {
    compilerModuleExtension.inheritCompilerOutputPath(true);
  }

  LibraryTable libraryTable = rootModel.getModuleLibraryTable();
  for (Pair<String, String> libInfo : myModuleLibraries) {
    final String moduleLibraryPath = libInfo.first;
    final String sourceLibraryPath = libInfo.second;
    Library library = libraryTable.createLibrary();
    Library.ModifiableModel modifiableModel = library.getModifiableModel();
    modifiableModel.addRoot(getUrlByPath(moduleLibraryPath), OrderRootType.CLASSES);
    if (sourceLibraryPath != null) {
      modifiableModel.addRoot(getUrlByPath(sourceLibraryPath), OrderRootType.SOURCES);
    }
    modifiableModel.commit();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:56,代码来源:JavaModuleBuilder.java


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