@Test public void worksWithAbsolutePath() throws Exception { File exeFile = FileHelper.resourceAsFile("/bin/hello-world-test.bat"); Path f = new Which(context) .command(exeFile.toString()) .run(); assertThat(f, is(not(nullValue()))); assertThat(f.toFile(), is(exeFile)); }
public Which command(String command) { ObjectHelper.requireNonNull("command", "command cannot be null"); this.command = Paths.get(command); return this; }
Which extends Action<Which.Result,Path> implements PathsMixin<Which> { public Which command(String command) { ObjectHelper.requireNonNull("command", "command cannot be null"); this.command = Paths.get(command); return this; } }
Which extends Action<Which.Result,Path> implements PathsMixin<Which> { public Which command(String command) { ObjectHelper.requireNonNull("command", "command cannot be null"); this.command = Paths.get(command); return this; } Which(Context context); }
Which extends Action<Which.Result,Path> implements PathsMixin<Which> { public Which command(String command) { ObjectHelper.requireNonNull("command", "command cannot be null"); this.command = Paths.get(command); return this; } Which(Context context); Path getCommand(); Which command(String command); Which command(Path command); Which command(File command); @Override List<Path> getPaths(); static boolean isExecutableFile(Path file); static Path find(Context context, List<Path> paths, Path command); }
Which extends Action<Which.Result,Path> implements PathsMixin<Which> { public Which command(String command) { ObjectHelper.requireNonNull("command", "command cannot be null"); this.command = Paths.get(command); return this; } Which(Context context); Path getCommand(); Which command(String command); Which command(Path command); Which command(File command); @Override List<Path> getPaths(); static boolean isExecutableFile(Path file); static Path find(Context context, List<Path> paths, Path command);  }