Here you can find the source of getRandomNum()
public static String getRandomNum()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Random; public class Main { public static String getRandomNum() { SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssS"); Date now = new Date(); String s = sdf.format(now); Random rd = new Random(); int rdNum = rd.nextInt(1000); String subDir = s + String.valueOf(rdNum); return subDir; }/*from www . ja va 2 s .c o m*/ }