Here you can find the source of getTempFile(String config)
public static File getTempFile(String config)
//package com.java2s; /******************************************************************************* * Copyright (c) 2011 cnfree.// w w w. j a va 2 s. c o m * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * cnfree - initial API and implementation *******************************************************************************/ import java.io.File; public class Main { public static File getTempFile(String config) { return getTempFile(config, ".xml"); } public static File getTempFile(String config, String suffix) { try { Thread.sleep(10); } catch (InterruptedException e) { } String filePath = System.getProperty("java.io.tmpdir") + System.currentTimeMillis() + "\\" + config.substring(config.lastIndexOf('/') + 1, config.lastIndexOf('.')) + suffix; File configFile = new File(filePath); if (!configFile.exists()) { if (!configFile.getParentFile().exists()) { configFile.getParentFile().mkdirs(); } } return configFile; } }