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


Java PathManager.getBinPath方法代碼示例

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


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

示例1: getRunnerPath

import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
@Nullable
private static String getRunnerPath() {
  if (!SystemInfo.isWindows) {
    throw new IllegalStateException("There is no need of runner under unix based OS");
  }
  final String path = System.getenv(IDEA_RUNNERW);
  if (path != null) {
    if (new File(path).exists()) {
      return path;
    }
    LOG.warn("Cannot locate " + STANDARD_RUNNERW + " by " + IDEA_RUNNERW + " environment variable (" + path + ")");
  }
  File runnerw = new File(PathManager.getBinPath(), STANDARD_RUNNERW);
  if (runnerw.exists()) {
    return runnerw.getPath();
  }
  LOG.warn("Cannot locate " + STANDARD_RUNNERW + " by default path (" + runnerw.getAbsolutePath() + ")");
  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:20,代碼來源:RunnerMediator.java

示例2: doGetSettingsFilePath

import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
@NotNull
private static String doGetSettingsFilePath(boolean customLocation) {
  final String vmOptionsFile = System.getProperty("jb.vmOptionsFile");
  if (!StringUtil.isEmptyOrSpaces(vmOptionsFile)) {
    return vmOptionsFile;
  }

  if (SystemInfo.isMac) {
    if (customLocation) {
      return PathManager.getConfigPath() + "/idea.vmoptions";
    }
    else {
      return PathManager.getBinPath() + "/idea.vmoptions";
    }
  }

  final String productName = ApplicationNamesInfo.getInstance().getProductName().toLowerCase(Locale.US);
  final String platformSuffix = SystemInfo.is64Bit ? "64" : "";
  final String osSuffix = SystemInfo.isWindows ? ".exe" : "";
  return PathManager.getBinPath() + File.separatorChar + productName + platformSuffix + osSuffix + ".vmoptions";
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:22,代碼來源:VMOptions.java

示例3: nativeCopy

import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
static boolean nativeCopy(File fromFile, File toFile, boolean syncTimestamp) {
  File launcherFile = new File(PathManager.getBinPath(), "vistalauncher.exe");
  try {
    // todo vistalauncher should be replaced with generic "elevate" process
    // todo   so the second java process will be unnecessary: plain 'elevate cmd /C copy' will work
    return execExternalProcess(new String[]{launcherFile.getPath(),
      //"cmd",  "/C", "move", fromFile.getPath(),
      //toFile.getPath()

      System.getProperty("java.home") + "/bin/java",
      "-classpath",
      PathManager.getLibPath() + "/util.jar",
      WinUACTemporaryFix.class.getName(),
      "copy",
      fromFile.getPath(),
      toFile.getPath(),
      String.valueOf(syncTimestamp),
      // vistalauncher hack
      "install",
      toFile.getParent()
    });
  }
  catch (Exception ex) {
    return false;
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:27,代碼來源:WinUACTemporaryFix.java

示例4: loadPlatformLibrary

import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
public static void loadPlatformLibrary(@NotNull String libName) {
  String libFileName = mapLibraryName(libName);
  String libPath = PathManager.getBinPath() + "/" + libFileName;

  if (!new File(libPath).exists()) {
    String platform = getPlatformName();
    if (!new File(libPath = PathManager.getHomePath() + "/community/bin/" + platform + libFileName).exists()) {
      if (!new File(libPath = PathManager.getHomePath() + "/bin/" + platform + libFileName).exists()) {
        if (!new File(libPath = PathManager.getHomePathFor(IdeaWin32.class) + "/bin/" + libFileName).exists()) {
          File libDir = new File(PathManager.getBinPath());
          throw new UnsatisfiedLinkError("'" + libFileName + "' not found in '" + libDir + "' among " + Arrays.toString(libDir.list()));
        }
      }
    }
  }

  System.load(libPath);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:19,代碼來源:UrlClassLoader.java

示例5: create

import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
public static RecentProjectMetaInfo create() {
  RecentProjectMetaInfo info = new RecentProjectMetaInfo();
  info.build = ApplicationInfoEx.getInstanceEx().getBuild().asString();
  info.productionCode = ApplicationInfoEx.getInstanceEx().getBuild().getProductCode();
  info.eap = ApplicationInfoEx.getInstanceEx().isEAP();
  info.binFolder = PathManager.getBinPath();
  info.projectOpenTimestamp = System.currentTimeMillis();
  info.buildTimestamp = ApplicationInfoEx.getInstanceEx().getBuildDate().getTimeInMillis();
  return info;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:11,代碼來源:RecentProjectsManagerBase.java

示例6: getShellEnv

import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
private static Map<String, String> getShellEnv() throws Exception {
  String shell = System.getenv("SHELL");
  if (shell == null || !new File(shell).canExecute()) {
    throw new Exception("shell:" + shell);
  }

  File reader = FileUtil.findFirstThatExist(
    PathManager.getBinPath() + "/printenv.py",
    PathManager.getHomePath() + "/community/bin/mac/printenv.py",
    PathManager.getHomePath() + "/bin/mac/printenv.py"
  );
  if (reader == null) {
    throw new Exception("bin:" + PathManager.getBinPath());
  }

  File envFile = FileUtil.createTempFile("intellij-shell-env.", ".tmp", false);
  try {
    String[] command = {shell, "-l", "-i", "-c", ("'" + reader.getAbsolutePath() + "' '" + envFile.getAbsolutePath() + "'")};
    LOG.info("loading shell env: " + StringUtil.join(command, " "));

    Process process = Runtime.getRuntime().exec(command);
    int rv = waitAndTerminateAfter(process, SHELL_ENV_READING_TIMEOUT);

    String lines = FileUtil.loadFile(envFile);
    if (rv != 0 || lines.isEmpty()) {
      throw new Exception("rv:" + rv + " text:" + lines.length());
    }
    return parseEnv(lines);
  }
  finally {
    FileUtil.delete(envFile);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:34,代碼來源:EnvironmentUtil.java

示例7: installPatch

import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
private static void installPatch() throws Exception {
  String platform = System.getProperty(PLATFORM_PREFIX_PROPERTY, "idea");
  String patchFileName = ("jetbrains.patch.jar." + platform).toLowerCase(Locale.US);
  String tempDir = System.getProperty("java.io.tmpdir");

  // always delete previous patch copy
  File patchCopy = new File(tempDir, patchFileName + "_copy");
  File log4jCopy = new File(tempDir, "log4j.jar." + platform + "_copy");
  File jnaUtilsCopy = new File(tempDir, "jna-platform.jar." + platform + "_copy");
  File jnaCopy = new File(tempDir, "jna.jar." + platform + "_copy");
  if (!FileUtilRt.delete(patchCopy) || !FileUtilRt.delete(log4jCopy) || !FileUtilRt.delete(jnaUtilsCopy) || !FileUtilRt.delete(jnaCopy)) {
    throw new IOException("Cannot delete temporary files in " + tempDir);
  }

  File patch = new File(tempDir, patchFileName);
  if (!patch.exists()) return;

  File log4j = new File(PathManager.getLibPath(), "log4j.jar");
  if (!log4j.exists()) throw new IOException("Log4J is missing: " + log4j);

  File jnaUtils = new File(PathManager.getLibPath(), "jna-platform.jar");
  if (!jnaUtils.exists()) throw new IOException("jna-platform.jar is missing: " + jnaUtils);

  File jna = new File(PathManager.getLibPath(), "jna.jar");
  if (!jna.exists()) throw new IOException("jna is missing: " + jna);

  copyFile(patch, patchCopy, true);
  copyFile(log4j, log4jCopy, false);
  copyFile(jna, jnaCopy, false);
  copyFile(jnaUtils, jnaUtilsCopy, false);

  int status = 0;
  if (Restarter.isSupported()) {
    List<String> args = new ArrayList<String>();

    if (SystemInfoRt.isWindows) {
      File launcher = new File(PathManager.getBinPath(), "VistaLauncher.exe");
      args.add(Restarter.createTempExecutable(launcher).getPath());
      Restarter.createTempExecutable(new File(PathManager.getBinPath(), "restarter.exe"));
    }

    //noinspection SpellCheckingInspection
    String java = getJava();
    Collections.addAll(args,
                       java,
                       "-Xmx750m",
                       "-Djna.nosys=true",
                       "-Djna.boot.library.path=",
                       "-Djna.debug_load=true",
                       "-Djna.debug_load.jna=true",
                       "-classpath",
                       patchCopy.getPath() + pathSeparator + log4jCopy.getPath() + pathSeparator + jnaCopy.getPath() + pathSeparator + jnaUtilsCopy.getPath(),
                       "-Djava.io.tmpdir=" + tempDir,
                       "-Didea.updater.log=" + PathManager.getLogPath(),
                       "-Dswing.defaultlaf=" + UIManager.getSystemLookAndFeelClassName(),
                       "com.intellij.updater.Runner",
                       "install",
                       PathManager.getHomePath());

    status = Restarter.scheduleRestart(ArrayUtilRt.toStringArray(args));
  }
  else {
    String message = "Patch update is not supported - please do it manually";
    showMessage("Update Error", message, true);
  }

  System.exit(status);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:69,代碼來源:Main.java


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