当前位置: 首页>>代码示例>>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;未经允许,请勿转载。