Here you can find the source of getRandomFile(String testName)
public static String getRandomFile(String testName) throws Exception
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { public static String getRandomFile(String testName) throws Exception { File parent = getTestDir(); File result = new File(parent, getRandomFileName(testName)); return result.getCanonicalPath(); }// w w w . j a va 2 s . c om public static File getTestDir() { File currentDir = new File(System.getProperty("user.dir")); if (!currentDir.exists()) { currentDir = new File("."); } String sep = File.separator; File testDir = new File(currentDir, "dist" + sep + "testresults" + sep + "test_temp_dir"); testDir.mkdirs(); return testDir; } public static String getRandomFileName(String testName) { return testName + System.currentTimeMillis() + "_" + Math.random(); } }