code: public static String makeShellPath(File file, boolean makeCanonicalPath)
    throws IOException {
      if (makeCanonicalPath) {
        return makeShellPath(file.getCanonicalPath());
      } else {
        return makeShellPath(file.toString());
      }
    }
docs: Convert a os-native filename to a path that works for the shell.
  @param file The filename to convert
  @param makeCanonicalPath
  Whether to make canonical path for the file passed
  @return The unix pathname
  @throws IOException on windows, there can be problems with the subprocess