Java File Name Create generateFileName()

Here you can find the source of generateFileName()

Description

generate File Name

License

Open Source License

Declaration

public static String generateFileName() 

Method Source Code

//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;
    }
}

Related

  1. fileName(String path)
  2. filename(String prefix, String sep, String index)
  3. FileName(String[] args)
  4. generateFileId(String userlogin)
  5. generateFileName()
  6. generateFileName(String fileName)
  7. generateFileNameWithoutExtension(final String testClassName, final String testId, final boolean includeDate)
  8. getRandomFileName(@Nullable final String prefix)
  9. toFileName(final Object obj)