I have created a text file with simple date concept. Everyday the textfile will be stored on my system with that day's date. I am sending these text files to the server automatically using timer concept.
Now my question is I would like to send the previous day's text file to the server. For ex: if today is monday, and here as per my timer schedule at 8, I need to send sunday's(previous day) text file to server. I am stuck here and I don't know how to achieve this. Here is my codings
File mydir = new File("file path");
mydir.mkdirs();
final String filename = new SimpleDateFormat("dd-MM-yyyy").format(new Date());
File outputFile = new File(mydir, filename);
FileOutputStream fos = new FileOutputStream(outputFile,true);