improved compatibility with '//' and 'file:/hdfs' in filename