Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=58086 Fixed wrong if clause that causes FileNotFoundException. Based on a patch provided by Lukasz Jader.