/** * Make a temporary file. * * @param parent Parent directory. * @param name File name. * @return File object to temporary file. * @throws IOException */ public static File createTempFile(File parent, String name) throws IOException { return createTestTempFileOrDir(parent, name, false); }
/** * Make a temporary directory. * * @param parent Parent directory. * @param name Directory name. * @return File object to temporary file. * @throws IOException */ public static File createTempDir(File parent, String name) throws IOException { File dir = createTestTempFileOrDir(parent, name, true); if (!dir.delete()) { LOG.error("createTempDir: Failed to create directory " + dir); } return dir; }