Java examples for File Path IO:Temporary File
Create temporary file in specified directory
import java.io.*; public class Main { public static void main(String[] args) { File file = null;//from w w w . j av a2s . c o m File dir = new File("C://FileIO"); try { file = File.createTempFile("JavaTemp", ".javatemp", dir); } catch(IOException ioe) { System.out.println("Exception creating temporary file : " + ioe); } System.out.println("Temporary file created at : " + file.getPath()); } }