Here you can find the source of generateFileName(String path)
public static String generateFileName(String path)
//package com.java2s; //License from project: Open Source License import java.util.UUID; public class Main { public static String generateFileName(String path) { String suffix = ""; if (path.lastIndexOf(".") != -1) { suffix = path.substring(path.lastIndexOf(".")); }//from w w w .ja va 2 s . c o m return UUID.randomUUID().toString() + suffix; } }