Try using getAbsolutePath() instead of getName(). getName() returns the name of the file only eg no path information to the file