Java examples for java.io:File Name
generate Unique File Name
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { String prefix = "java2s.com"; String suffix = "com"; System.out.println(generateUniqueFileName(prefix, suffix)); }//w ww. j a v a2 s. c o m public static String generateUniqueFileName(String prefix, String suffix) { return (prefix != null ? prefix : "") + System.nanoTime() + (suffix != null ? suffix : ""); } }