本文整理汇总了Java中com.intellij.execution.configurations.PathEnvironmentVariableUtil.findInPath方法的典型用法代码示例。如果您正苦于以下问题:Java PathEnvironmentVariableUtil.findInPath方法的具体用法?Java PathEnvironmentVariableUtil.findInPath怎么用?Java PathEnvironmentVariableUtil.findInPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.configurations.PathEnvironmentVariableUtil
的用法示例。
在下文中一共展示了PathEnvironmentVariableUtil.findInPath方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findExecutable
import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入方法依赖的package包/类
@NotNull
protected static String findExecutable(@NotNull String programName,
@NotNull String unixExec,
@NotNull String winExec,
@NotNull Collection<String> envs) {
String exec = findEnvValue(programName, envs);
if (exec != null) {
return exec;
}
File fileExec = PathEnvironmentVariableUtil.findInPath(SystemInfo.isWindows ? winExec : unixExec);
if (fileExec != null) {
return fileExec.getAbsolutePath();
}
throw new IllegalStateException(programName + " executable not found. " + (envs.size() > 0 ?
"Please define a valid environment variable " +
envs.iterator().next() +
" pointing to the " +
programName +
" executable." : ""));
}
示例2: suggestSdkDirectoryPathFromEnv
import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入方法依赖的package包/类
@Nullable
private static String suggestSdkDirectoryPathFromEnv() {
File fileFromPath = PathEnvironmentVariableUtil.findInPath(SquirrelConstants.SQUIRREL_COMPILER_NAME);
if (fileFromPath != null) {
File canonicalFile;
try {
canonicalFile = fileFromPath.getCanonicalFile();
String path = canonicalFile.getPath();
if (path.endsWith("bin/" + SquirrelConstants.SQUIRREL_COMPILER_NAME)) {
return StringUtil.trimEnd(path, "bin/" + SquirrelConstants.SQUIRREL_COMPILER_NAME);
}
} catch (IOException ignore) {
}
}
return null;
}
示例3: getCondaExecutable
import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入方法依赖的package包/类
@Nullable
public static String getCondaExecutable() {
final String condaName = SystemInfo.isWindows ? "conda.exe" : "conda";
final File condaInPath = PathEnvironmentVariableUtil.findInPath(condaName);
if (condaInPath != null) return condaInPath.getPath();
return getCondaExecutable(condaName);
}
示例4: findExecutable
import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入方法依赖的package包/类
@Nonnull
public static String findExecutable(@Nonnull String programName, @Nonnull String unixExec, @Nonnull String winExec, @Nonnull Collection<String> envs) {
String exec = findEnvValue(programName, envs);
if (exec != null) {
return exec;
}
File fileExec = PathEnvironmentVariableUtil.findInPath(SystemInfo.isWindows ? winExec : unixExec);
if (fileExec != null) {
return fileExec.getAbsolutePath();
}
throw new IllegalStateException(programName +
" executable not found. " +
(envs.size() > 0 ? "Please define a valid environment variable " + envs.iterator().next() + " pointing to the " + programName + " executable." : ""));
}
示例5: get
import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入方法依赖的package包/类
@NotNull
public static SceneBuilderInfo get(Project project, boolean choosePathIfEmpty) {
JavaFxSettings settings = JavaFxSettings.getInstance();
String pathToSceneBuilder = settings.getPathToSceneBuilder();
if (StringUtil.isEmptyOrSpaces(pathToSceneBuilder) || !new File(pathToSceneBuilder).exists()) {
VirtualFile sceneBuilderFile = null;
if (choosePathIfEmpty) {
sceneBuilderFile = FileChooser.chooseFile(JavaFxSettingsConfigurable.createSceneBuilderDescriptor(), project, getPredefinedPath());
}
if (sceneBuilderFile == null) {
return EMPTY;
}
pathToSceneBuilder = FileUtil.toSystemIndependentName(sceneBuilderFile.getPath());
settings.setPathToSceneBuilder(pathToSceneBuilder);
}
File sceneBuilderLibsFile;
if (SystemInfo.isMac) {
sceneBuilderLibsFile = new File(new File(pathToSceneBuilder, "Contents"), "Java");
}
else if (SystemInfo.isWindows) {
File sceneBuilderRoot = new File(pathToSceneBuilder);
File sceneBuilderRootDir = sceneBuilderRoot.getParentFile();
if (sceneBuilderRootDir == null) {
final File foundInPath = PathEnvironmentVariableUtil.findInPath(pathToSceneBuilder);
if (foundInPath != null) {
sceneBuilderRootDir = foundInPath.getParentFile();
}
}
sceneBuilderRoot = sceneBuilderRootDir != null ? sceneBuilderRootDir.getParentFile() : null;
if (sceneBuilderRoot != null) {
final File appFile = new File(sceneBuilderRootDir, "app");
if (appFile.isDirectory()) {
sceneBuilderLibsFile = appFile;
}
else {
final File libFile = new File(sceneBuilderRoot, "lib");
sceneBuilderLibsFile = libFile.isDirectory() ? libFile : null;
}
}
else {
sceneBuilderLibsFile = null;
}
}
else {
sceneBuilderLibsFile = new File(new File(pathToSceneBuilder).getParent(), "app");
}
if (sceneBuilderLibsFile != null && (!sceneBuilderLibsFile.exists() || !sceneBuilderLibsFile.isDirectory())) {
sceneBuilderLibsFile = null;
}
return new SceneBuilderInfo(pathToSceneBuilder, sceneBuilderLibsFile == null ? null : sceneBuilderLibsFile.getAbsolutePath());
}
示例6: getMakeExecutable
import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入方法依赖的package包/类
@Nullable
public static String getMakeExecutable() {
File make = PathEnvironmentVariableUtil.findInPath("make");
if (make == null) return null;
return make.getAbsolutePath();
}
示例7: findInPath
import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入方法依赖的package包/类
public File findInPath(String fileName) {
return PathEnvironmentVariableUtil.findInPath(fileName);
}