Created
August 26, 2013 15:13
-
-
Save sachin-handiekar/6342530 to your computer and use it in GitHub Desktop.
Creating a temporary file in Java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javaee.insight; | |
import java.io.File; | |
import java.io.IOException; | |
public class CreateTempFileTest { | |
public static void main(String[] args) { | |
try { | |
// create a temp file | |
File temp = File.createTempFile("sample", ".tmp"); | |
System.out.println("Temp file : " + temp.getAbsolutePath()); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment