FileUtil { public static File createTempFile(String filePrefix, String fileSuffix) throws IOException { return File.createTempFile(filePrefix, fileSuffix, baseDir); }  static File createTempFile(String filePrefix, String fileSuffix); static File mktempdir(String filePrefix); static File mktempdir(); static boolean rmr(File path); static void dumbfilecopy(File source, File dest); static boolean makeDirs(File f);  }
@Test public void testCreateTempFile() throws IOException { File f = FileUtil.createTempFile("foo", ".bar"); f.deleteOnExit(); String matchPat = FileUtil.getBaseDir() + ".*foo.*\\.bar"; assertTrue(f.getAbsolutePath().matches(matchPat)); }