btw apache commons-io is useful for this sort of thing