Fixed exception due to invalid characters in filename (JENKINS-15438)

https://issues.jenkins-ci.org/browse/JENKINS-15438