fixes for FileEntitySchemeInputStream; make use of it when downloading files