當前位置: 首頁>>代碼示例>>Java>>正文


Java SystemInfo.isOS2方法代碼示例

本文整理匯總了Java中com.intellij.openapi.util.SystemInfo.isOS2方法的典型用法代碼示例。如果您正苦於以下問題:Java SystemInfo.isOS2方法的具體用法?Java SystemInfo.isOS2怎麽用?Java SystemInfo.isOS2使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.util.SystemInfo的用法示例。


在下文中一共展示了SystemInfo.isOS2方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: convertFromUrl

import com.intellij.openapi.util.SystemInfo; //導入方法依賴的package包/類
@NotNull
public static String convertFromUrl(@NotNull URL url) {
  String protocol = url.getProtocol();
  String path = url.getPath();
  if (protocol.equals(URLUtil.JAR_PROTOCOL)) {
    if (StringUtil.startsWithConcatenation(path, URLUtil.FILE_PROTOCOL, PROTOCOL_DELIMITER)) {
      try {
        URL subURL = new URL(path);
        path = subURL.getPath();
      }
      catch (MalformedURLException e) {
        throw new RuntimeException(VfsBundle.message("url.parse.unhandled.exception"), e);
      }
    }
    else {
      throw new RuntimeException(new IOException(VfsBundle.message("url.parse.error", url.toExternalForm())));
    }
  }
  if (SystemInfo.isWindows || SystemInfo.isOS2) {
    while (!path.isEmpty() && path.charAt(0) == '/') {
      path = path.substring(1, path.length());
    }
  }

  path = URLUtil.unescapePercentSequences(path);
  return protocol + "://" + path;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:28,代碼來源:VfsUtilCore.java

示例2: convertToIOFile

import com.intellij.openapi.util.SystemInfo; //導入方法依賴的package包/類
@NotNull
protected static File convertToIOFile(@NotNull final VirtualFile file) {
  String path = file.getPath();
  if (StringUtil.endsWithChar(path, ':') && path.length() == 2 && (SystemInfo.isWindows || SystemInfo.isOS2)) {
    path += "/"; // Make 'c:' resolve to a root directory for drive c:, not the current directory on that drive
  }

  return new File(path);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:LocalFileSystemBase.java

示例3: getRunner

import com.intellij.openapi.util.SystemInfo; //導入方法依賴的package包/類
@Nullable
public static VirtualFile getRunner(VirtualFile baseDir) {
  if (baseDir == null) return null;
  final VirtualFile cfg = baseDir.findChild(BUILDOUT_CFG);
  if (cfg != null && !cfg.isDirectory()) {
    VirtualFile eggs = baseDir.findChild("eggs");
    if (eggs != null && eggs.isDirectory()) {
      VirtualFile bin = baseDir.findChild("bin");
      if (bin != null && bin.isDirectory()) {
        if (ApplicationManager.getApplication().isDispatchThread() || !ApplicationManager.getApplication().isReadAccessAllowed()) {
          bin.refresh(false, false);
        }
        final String exe;
        if (SystemInfo.isWindows || SystemInfo.isOS2) {
          exe = "buildout.exe";
        }
        else {
          exe = "buildout";
        }
        VirtualFile runner = bin.findChild(exe);
        if (runner != null && !runner.isDirectory()) {
          return runner;
        }
      }
    }
  }
  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:29,代碼來源:BuildoutFacet.java


注:本文中的com.intellij.openapi.util.SystemInfo.isOS2方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。