Daniel Beck commented on Bug JENKINS-17267

It doesn't help that the Java runtime (maybe assisted by Windows) claims that junction points are a directory.

Create a new freestyle project named JENKINS-17267, add a Windows Batch build step:

mklink /d s c:\existingTargetFolder
mklink /j j c:\existingTargetFolder
md d

Build once. Then open Script Console and run the following script:

def s = new File(Jenkins.instance.getItemByFullName('JENKINS-17267').someWorkspace.child('s').getRemote())
def j = new File(Jenkins.instance.getItemByFullName('JENKINS-17267').someWorkspace.child('j').getRemote())
def d = new File(Jenkins.instance.getItemByFullName('JENKINS-17267').someWorkspace.child('d').getRemote())
[s, j, d].each {
  println java.nio.file.Files.isDirectory(it.toPath())
  println java.nio.file.Files.isDirectory(it.toPath(), java.nio.file.LinkOption.NOFOLLOW_LINKS)
  println java.nio.file.Files.isSymbolicLink(it.toPath())
  println ""
}
return

Output:

true
false
true

true
true
false

true
true
false

In other words, a pure Java program has no chance to distinguish between a junction and an actual folder.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to