Ari Hyttinen created JENKINS-13028:
--------------------------------------
Summary: hudson.FilePath.isAbsolute() method thinks Windows paths
starting with \\ are not absolute
Key: JENKINS-13028
URL: https://issues.jenkins-ci.org/browse/JENKINS-13028
Project: Jenkins
Issue Type: Bug
Components: core
Reporter: Ari Hyttinen
When user supplies a network share file path (for example
\\path\to\share\file.xxx)
to a field, which uses FilePath.child() method to get FilePath object for the
file, it does not work, because FilePath.isAbsolute() method returns false for
the path, and then current workspace is prepended to it.
If using drive letter, for example X:\mapped\path\file.xxx, then isAbsolute
detects it correctly, and FilePath.child() returns valid FilePath object.
Kludgy workaround (in plugin code) I've been using is:
if pathString starts with \\,
then get new FilePath(pathString),
else get FilePath.child(pathString).
User workarounds are to copy the file from share to workspace with separate
build step, or to map the share to a drive letter if possible.
Note: hudson/FilePath.java already has regexp for detecting \\-paths, but for
some reason isAbsolute() uses different regexp, which only detects driver
letter and /-paths.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira