[JENKINS-29956] Test Windows junctions before Java 7 symlink (#1787)
* Test Windows junctions before Java 7 symlink Apparently Java 7 (and later) do not count Windows junctions as symlinks. When you drill down into the BasicFileAttributes structure, reparse points are only counted under isOther. So, since we already have code that properly detects Windows Junctions, let's use that first and then fallback to the Java 7 code. * Add comment for change & link bug. * Add test case * Switch to Functions.isWindows(). * Use non-deprecated APIs for tmp file/dir mgmt * Add better debugging. * Allow spaces in junction name & dir name. To do that, it was easier to use ProcessBuilder vs building up the correct string in code to send to cmd.exe. Also, I'll note that according to http://ss64.com/nt/syntax-internal.html, mklink is in internal cmd.exe command. So, it must be invoked through "cmd.exe /c" for it to work. * Remove comment mentioning bug number. * Remove debugging output, per Baptiste's request * Add newline at end of file. * Make sure that the junction was removed. * Use assertEquals to show retcode of Process.waitFor. * Fix compilation errors by importing functions
Loading
Please register or sign in to comment