Secure temporary file: Difference between revisions

Line 205:
 
=={{header|Java}}==
 
<lang java>import java.io.File;
import java.io.IOException;
 
public class CreateTempFileExample {
public static void main(String[] args) {
 
public static void main(String[] args) try {
//create a temp file
try{
//create a File temp = File.createTempFile("temp-file-name", ".tmp");
File temp = File System.createTempFileout.println("temp-Temp file-name", : " + temp.tmp"getAbsolutePath());
}
} catch(IOException e) {
System.out.println("Temp file : " + temp.getAbsolutePath());
e.printStackTrace();
} catch(IOException e) {
e.printStackTrace();
}
}
}</lang>
 
Anonymous user