I'm currently trying to execute a cmd in an external directory using ProcessBuilder. When I convert my URL to a File, a method in the File class that removes redundancies (File.fs.normalize) is called and reduces the "//" that I need in the "https://" of my directory to "/".
ProcessBuilder pb = new ProcessBuilder("cmd",
"/C",
"svn",
"status",
"-v",
"|",
"findstr",
"/R",
"^C");
String svnstr = mergeUrl.toString();
File q = new File(svnstr);
pb.directory(q);
Process p = pb.start();
And I am receiving this error:
java.io.IOException: Cannot run program "cmd" (in directory "https:\www.example.com\Archival-rel20.3"): CreateProcess error=267, The directory name is invalid
Is there anyway to salvage the URL address when converting to a File
? The only other option I've found would be to use Runtime
, which also passes a File
as a directory parameter?