com.intellij.openapi.util.io.FileUtil.join()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(142)

本文整理了Java中com.intellij.openapi.util.io.FileUtil.join()方法的一些代码示例,展示了FileUtil.join()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtil.join()方法的具体详情如下:
包路径:com.intellij.openapi.util.io.FileUtil
类名称:FileUtil
方法名:join

FileUtil.join介绍

暂无

代码示例

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

@Nullable
private static String getGaeExecutablePath(@NotNull String sdkHomePath) {
 String goExecutablePath = PathUtil.toSystemIndependentName(sdkHomePath);
 goExecutablePath = StringUtil.trimEnd(goExecutablePath, GoConstants.APP_ENGINE_GO_ROOT_DIRECTORY_PATH);
 boolean gcloudInstallation = goExecutablePath.endsWith(GoConstants.GCLOUD_APP_ENGINE_DIRECTORY_PATH);
 if (gcloudInstallation) {
  LOG.debug("Detected gcloud GAE installation at " + goExecutablePath);
  goExecutablePath = FileUtil.join(StringUtil.trimEnd(goExecutablePath, GoConstants.GCLOUD_APP_ENGINE_DIRECTORY_PATH), "bin");
 }
 String executablePath = FileUtil.join(goExecutablePath, GoEnvironmentUtil.getGaeExecutableFileName(gcloudInstallation));
 return new File(executablePath).exists() ? executablePath : null;
}

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

@Nullable
private static VirtualFile getSdkSrcDir(@NotNull String sdkPath, @NotNull String sdkVersion) {
 String srcPath = getSrcLocation(sdkVersion);
 VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(VfsUtilCore.pathToUrl(FileUtil.join(sdkPath, srcPath)));
 return file != null && file.isDirectory() ? file : null;
}

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

String executable = FileUtil.join(sdkHomePath, "bin", executableName);
  if (file.exists() && file.isDirectory()) {
   LOG.debug("Go executable found at " + file.getAbsolutePath());
   return FileUtil.join(file.getAbsolutePath(), executableName);

代码示例来源:origin: ballerina-platform/ballerina-lang

@Nullable
private static VirtualFile getSdkSrcDir(@NotNull String sdkPath, @NotNull String sdkVersion) {
  String srcPath = getSrcLocation(sdkVersion);
  VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(
      VfsUtilCore.pathToUrl(FileUtil.join(sdkPath, srcPath)));
  return file != null && file.isDirectory() ? file : null;
}

代码示例来源:origin: ballerina-platform/ballerina-lang

String executable = FileUtil.join(sdkHomePath, "bin", executableName);
if (!new File(executable).exists() && SystemInfo.isLinux) {
  LOG.debug(executable + " doesn't exists. Looking for binaries in fedora-specific directories");
    if (file.exists() && file.isDirectory()) {
      LOG.debug("Ballerina executable found at " + file.getAbsolutePath());
      return FileUtil.join(file.getAbsolutePath(), executableName);

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

@Nullable
protected VirtualFile findFile(@NotNull String filePath) {
 VirtualFile virtualFile = VirtualFileManager.getInstance().findFileByUrl(VfsUtilCore.pathToUrl(filePath));
 if (virtualFile == null) {
  String path = FileUtil.join(getWorkingDirectory(), filePath);
  virtualFile = VirtualFileManager.getInstance().findFileByUrl(VfsUtilCore.pathToUrl(path));
 }
 return virtualFile;
}

代码示例来源:origin: ballerina-platform/ballerina-lang

@Nullable
protected VirtualFile findFile(@NotNull String filePath) {
  VirtualFile virtualFile = VirtualFileManager.getInstance().findFileByUrl(VfsUtilCore.pathToUrl(filePath));
  if (virtualFile == null) {
    String path = FileUtil.join(getWorkingDirectory(), filePath);
    virtualFile = VirtualFileManager.getInstance().findFileByUrl(VfsUtilCore.pathToUrl(path));
  }
  return virtualFile;
}

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

private void doTestImportOwnPath(String text, String testText, boolean shouldImport) {
 updateSettings(false);
 myFixture.addFileToProject(FileUtil.join("pack", "a.go"), text);
 PsiFile testFile = myFixture.addFileToProject(FileUtil.join("pack", "a_test.go"), testText);
 myFixture.configureFromExistingVirtualFile(testFile.getVirtualFile());
 List<IntentionAction> actions = myFixture.filterAvailableIntentions("Import " + "pack" + "?");
 assertTrue(shouldImport != actions.isEmpty());
}

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

String directoryPath = FileUtil.isAbsolutePlatformIndependent(myDirectoryPath)
            ? myDirectoryPath
            : FileUtil.join(getWorkingDirectory(), myDirectoryPath);

代码示例来源:origin: Camelcade/Perl5-IDEA

/**
 * @return perl5 dir in the ide's {@code system} dir
 */
@NotNull
public static String getPerlSystemPath() {
 String systemPath = PathManager.getSystemPath();
 String perlDirectory = FileUtil.join(systemPath, PERL_DIR);
 FileUtil.createDirectory(new File(perlDirectory));
 return perlDirectory;
}

代码示例来源:origin: Camelcade/Perl5-IDEA

/**
  * @return root for remote filesystems cache
  */
 @NotNull
 public static String getRemotesCachePath() {
  String remotesCachePath = FileUtil.join(getPerlSystemPath(), REMOTES_DIR);
  FileUtil.createDirectory(new File(remotesCachePath));
  return remotesCachePath;
 }
}

代码示例来源:origin: groboclown/p4ic4idea

@Nullable
private VirtualFile getFileAt(@NotNull String dir, @NotNull String name) {
  return LocalFileSystem.getInstance().findFileByPath(FileUtil.join(dir, name));
}

代码示例来源:origin: Camelcade/Perl5-IDEA

@Nullable
@Override
protected String doGetLocalPath(@NotNull String remotePath) {
 File remoteFile = new File(remotePath);
 if (FileUtil.isAncestor(CONTAINER_ROOT_FILE, remoteFile, false)) {
  return PerlFileUtil.unLinuxisePath('/' + FileUtil.getRelativePath(CONTAINER_ROOT_FILE, remoteFile));
 }
 return FileUtil.toSystemIndependentName(FileUtil.join(getLocalCacheRoot(), remotePath));
}

代码示例来源:origin: Camelcade/Perl5-IDEA

@Override
protected String getTestDataPath() {
 return FileUtil.join(super.getTestDataPath(), "test_more");
}

代码示例来源:origin: Camelcade/Perl5-IDEA

@Override
protected String getTestDataPath() {
 return FileUtil.join(super.getTestDataPath(), "compoundToStatement");
}

代码示例来源:origin: Camelcade/Perl5-IDEA

@Override
protected String getResultsTestDataPath() {
 return FileUtil.join(super.getResultsTestDataPath(), "moose");
}

代码示例来源:origin: Camelcade/Perl5-IDEA

@Override
protected String getTestDataPath() {
 return FileUtil.join(super.getTestDataPath(), "modifierToStatement");
}

代码示例来源:origin: Camelcade/Perl5-IDEA

@Override
protected String getTestDataPath() {
 return FileUtil.join(super.getTestDataPath(), "switch");
}

代码示例来源:origin: Camelcade/Perl5-IDEA

@Override
protected String getTestDataPath() {
 return FileUtil.join(super.getTestDataPath(), "trycatch");
}

代码示例来源:origin: Camelcade/Perl5-IDEA

@NotNull
private String getSvgDataPath() {
 return FileUtil.join(getTestDataPath(), "svg", getTestName(true) + ".svg");
}

相关文章