I am in need of creating a java program which should perform the following.
1. Read ALL the files located under c:\main dir
2. Append the read files into a Email.log file in the order in which the files are created.
For example: main directory has three files. A.txt(created on Aug1st2009,10:00AM), B.txt(created on Aug1st2009,10:01AM),C.txt(created on Aug1st2009,10:02AM)
Email.log file should contain the contents of A.txt then B.txt then C.txt. The contents of old file should appear in the top and the content of latest file(C.txt) shouled appeared in the bottom of Email.log file.
Hope you understand my requirements. could you help me out in starting with sample code?
We do not make homework.
BTW, you may need the following API's for your project :
- [*File*|http://java.sun.com/javase/6/docs/api/java/io/File.html] to parse the directory,
- [*TreeSet*|http://java.sun.com/javase/6/docs/api/java/util/TreeSet.html] to sort your items
- [*Logger*|http://java.sun.com/javase/6/docs/api/java/util/logging/Logger.html] to build your Email.log file.