[#1880] Use commons-io API to avoid re-inventing the wheel -  fixed compilation error with Java 6