當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。