I need to write some software to catalog files in a directory hierarchy. The directories of this hierarchy nominally follow
Files are then placed under the Date directory. The problem is that until now, files are copied into the hierarchy manually. Occaisionally files have been placed in the wrong spot, and directories below the top level have, occasionally, been created at the wrong spot, or out of order, in the hierarchy.
My initial approach is to use the directory information as meta data (country, city, date) to generate a database entry for each file. While I can recursively traverse the directories, I'm not sure of the best approach to verify (or determine) that a directory that I think is, say, a city, really is a city; not a tech_type.
The directory holds a sufficient number of files (> 1 million) to make manual cleanup a non-starter. This is more theory oriented question, I suppose, but since I will be doing this in Java I put it here. Thanks for any pointers.