Here you can find the source of getUniqueFileName(String fileNamePrefix, String fileExtension)
public static String getUniqueFileName(String fileNamePrefix, String fileExtension)
//package com.java2s; /******************************************************************************* * Educational Online Test Delivery System Copyright (c) 2014 American * Institutes for Research//from www. jav a 2s.co m * * Distributed under the AIR Open Source License, Version 1.0 See accompanying * file AIR-License-1_0.txt or at http://www.smarterapp.org/documents/ * American_Institutes_for_Research_Open_Source_Software_License.pdf ******************************************************************************/ import java.text.DateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static String getUniqueFileName(String fileNamePrefix, String fileExtension) { Date d = Calendar.getInstance().getTime(); long now = System.currentTimeMillis(); return "QTIScoringEngine_" + fileNamePrefix + "_" + DateFormat.getDateInstance(DateFormat.SHORT).format(d) .replace("/", "-") + "_" + DateFormat.getTimeInstance(DateFormat.LONG).format(d) .replace(" ", "").replace(":", "_") + fileExtension; } }