org.eclipse.jgit.util.FS.searchPath()方法的使用及代码示例

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

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

FS.searchPath介绍

[英]Searches the given path to see if it contains one of the given files. Returns the first it finds. Returns null if not found or if path is null.
[中]搜索给定路径以查看它是否包含给定文件之一。返回它找到的第一个。如果未找到或路径为null,则返回null。

代码示例

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

/**
 * Whether cygwin is found
 *
 * @return true if cygwin is found
 */
public static boolean isCygwin() {
  final String path = AccessController
      .doPrivileged(new PrivilegedAction<String>() {
        @Override
        public String run() {
          return System.getProperty("java.library.path"); //$NON-NLS-1$
        }
      });
  if (path == null)
    return false;
  File found = FS.searchPath(path, "cygpath.exe"); //$NON-NLS-1$
  if (found != null)
    cygpath = found.getPath();
  return cygpath != null;
}

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

/**
 * @return true if cygwin is found
 */
public static boolean isCygwin() {
  final String path = AccessController
      .doPrivileged(new PrivilegedAction<String>() {
        public String run() {
          return System.getProperty("java.library.path"); //$NON-NLS-1$
        }
      });
  if (path == null)
    return false;
  File found = FS.searchPath(path, "cygpath.exe"); //$NON-NLS-1$
  if (found != null)
    cygpath = found.getPath();
  return cygpath != null;
}

代码示例来源:origin: berlam/github-bucket

/**
 * Whether cygwin is found
 *
 * @return true if cygwin is found
 */
public static boolean isCygwin() {
  final String path = AccessController
      .doPrivileged(new PrivilegedAction<String>() {
        @Override
        public String run() {
          return System.getProperty("java.library.path"); //$NON-NLS-1$
        }
      });
  if (path == null)
    return false;
  File found = FS.searchPath(path, "cygpath.exe"); //$NON-NLS-1$
  if (found != null)
    cygpath = found.getPath();
  return cygpath != null;
}

相关文章