I would guess that Z:\Job Logging\addToDb is not a valid directory.
Refer to the doc for File#listFiles():
Returns: An array of abstract pathnames denoting the files and directories in the directory denoted by this abstract pathname. The array will be empty if the directory is empty. Returns null if this abstract pathname does not denote a directory, or if an I/O error occurs.