@Test public void testPathExists() throws Exception { File nonExisting = new File(temp.getRoot(), "i_do_not_exist"); File existing = temp.newFolder(); ShellCommandUtil.Result result; result = ShellCommandUtil.pathExists(existing.getAbsolutePath(), false); Assert.assertTrue(existing.exists()); Assert.assertTrue(result.isSuccessful()); result = ShellCommandUtil.pathExists(nonExisting.getAbsolutePath(), false); Assert.assertFalse(nonExisting.exists()); Assert.assertFalse(result.isSuccessful()); }
public static Result pathExists(String path, boolean sudo) throws IOException, InterruptedException { String[] command = { (WINDOWS) ? "dir" : "/bin/ls", path }; return runCommand(command, null, null, sudo); }
ShellCommandUtil { public static Result pathExists(String path, boolean sudo) throws IOException, InterruptedException { String[] command = { (WINDOWS) ? "dir" : "/bin/ls", path }; return runCommand(command, null, null, sudo); } }
ShellCommandUtil { public static Result pathExists(String path, boolean sudo) throws IOException, InterruptedException { String[] command = { (WINDOWS) ? "dir" : "/bin/ls", path }; return runCommand(command, null, null, sudo); }  }
ShellCommandUtil { public static Result pathExists(String path, boolean sudo) throws IOException, InterruptedException { String[] command = { (WINDOWS) ? "dir" : "/bin/ls", path }; return runCommand(command, null, null, sudo); }  static void logOpenSslExitCode(String command, int exitCode); static String hideOpenSslPassword(String command); static String getOpenSslCommandResult(String command, int exitCode); static String getUnixFilePermissions(String path); static void setUnixFilePermissions(String mode, String path); static Result setFileOwner(String path, String ownerName); static Result setFileGroup(String path,  String groupName); static Result setFileMode(String path,
                                   boolean ownerReadable, boolean ownerWritable, boolean ownerExecutable,
                                   boolean groupReadable, boolean groupWritable, boolean groupExecutable,
                                   boolean otherReadable, boolean otherWritable, boolean otherExecutable); static Result pathExists(String path, boolean sudo); static Result mkdir(String directoryPath, boolean sudo); static Result copyFile(String srcFile, String destFile, boolean force, boolean sudo); static Result delete(String file, boolean force, boolean sudo); static Result runCommand(List<String> args, Map<String, String> vars, InteractiveHandler interactiveHandler, boolean sudo); static Result runCommand(String[] args, Map<String, String> vars, InteractiveHandler interactiveHandler, boolean sudo); static Result runCommand(String[] args, Map<String, String> vars); static Result runCommand(String[] args); }
ShellCommandUtil { public static Result pathExists(String path, boolean sudo) throws IOException, InterruptedException { String[] command = { (WINDOWS) ? "dir" : "/bin/ls", path }; return runCommand(command, null, null, sudo); }  static void logOpenSslExitCode(String command, int exitCode); static String hideOpenSslPassword(String command); static String getOpenSslCommandResult(String command, int exitCode); static String getUnixFilePermissions(String path); static void setUnixFilePermissions(String mode, String path); static Result setFileOwner(String path, String ownerName); static Result setFileGroup(String path,  String groupName); static Result setFileMode(String path,
                                   boolean ownerReadable, boolean ownerWritable, boolean ownerExecutable,
                                   boolean groupReadable, boolean groupWritable, boolean groupExecutable,
                                   boolean otherReadable, boolean otherWritable, boolean otherExecutable); static Result pathExists(String path, boolean sudo); static Result mkdir(String directoryPath, boolean sudo); static Result copyFile(String srcFile, String destFile, boolean force, boolean sudo); static Result delete(String file, boolean force, boolean sudo); static Result runCommand(List<String> args, Map<String, String> vars, InteractiveHandler interactiveHandler, boolean sudo); static Result runCommand(String[] args, Map<String, String> vars, InteractiveHandler interactiveHandler, boolean sudo); static Result runCommand(String[] args, Map<String, String> vars); static Result runCommand(String[] args); static final boolean WINDOWS; static final boolean LINUX; static final boolean MAC; static final boolean UNIX_LIKE; static final String MASK_OWNER_ONLY_RW; static final String MASK_OWNER_ONLY_RWX; static final String MASK_EVERYBODY_RWX; }