My program searches for the last modified file and prints its full path and file name when the program is run. The code below says to get the last modified file from the current directory.

Code:
        public static void main(String[] args) {
                try {
                        System.out.println("The latest file in the current directory is " + 
                                        getLatest( new File(System.getProperty("user.dir") ) ) + ".");
                } catch (Exception e) {
                        e.printStackTrace();
                }
        }
        
}
I would like to be able to specify a different directory but dont know how to do this. Ideally I would like the path to the directory to be in a text file and for my program to read it from the text file. Anybody got any ideas how I would do this?