Here you can find the source of generateFileName()
public static String generateFileName()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private final static String pathStr = "D:\\projects\\Maintenance\\email_jmrp\\email content archive\\"; public static String generateFileName() { return generateFileName("", ".txt"); }/* w w w . j a va 2s.c o m*/ public static String generateFileName(String appendName, String extendName) { Date d = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); return pathStr + sdf.format(d) + appendName + extendName; } }