パッケージ com.kazurayam.subprocessj

クラス CommandLocator

java.lang.Object
com.kazurayam.subprocessj.CommandLocator

public class CommandLocator extends Object
  • コンストラクタの詳細

    • CommandLocator

      public CommandLocator()
  • メソッドの詳細

    • find

      public static CommandLocator.CommandLocatingResult find(String command)
      パラメータ:
      command - a command name. e.g, "git"
      戻り値:
      the CommandLocatingResult object. the CommandLocatingResult.command() will return a string which is the full path of the executable of the command. e.g, "/usr/local/bin/git"
    • find

      public static CommandLocator.CommandLocatingResult find(String command, Predicate<Path> predicate)
      see the documentation for detail.
    • startsWith

      public static Predicate<Path> startsWith(String pathFromRoot)
      パラメータ:
      pathFromRoot - e.g, Paths.get("C:\\Program Files\\Git\\cmd")
      戻り値:
      a Predicate to filter a List of Paths
    • endsWith

      public static Predicate<Path> endsWith(String pathEndingWith)
      パラメータ:
      pathEndingWith - e.g, Paths.get("cmd\\git.exe");
      戻り値:
      a Predicate to filter a List of Paths