Here you can find the source of generateKey()
public static final String generateKey()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static final String generateKey() { SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "yyyy-MM-dd-HH-mm-ss-SSS"); return simpleDateFormat.format(Calendar.getInstance().getTime()); }//from w ww .ja va2s .co m }