changed file io to use apache file utils