Here you can find the source of getTempFileName()
public static String getTempFileName()
//package com.java2s; import java.util.concurrent.atomic.AtomicInteger; public class Main { public static final String chars = "0123456789abcdefghijklmnopqrstuvwxyz-_$!~"; public static final long base = chars.length(); private static final AtomicInteger ai = new AtomicInteger(0); static CharSequence seqStart; /**//from w w w . j a v a 2s . c o m * Method (3) */ public static String getTempFileName() { StringBuilder res = new StringBuilder(12); res.append(seqStart); res.append(fromDecimal(ai.getAndIncrement())); return res.toString(); } private static CharSequence fromDecimal(long number) { StringBuilder result = new StringBuilder(12); do { result.insert(0, chars.charAt((int) (number % base))); number /= base; } while (number > 0); return result; } }