Advertisement
Guest User

Untitled

a guest
Sep 19th, 2014
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. public static File createTempDirectory()
  2. throws IOException
  3. {
  4. final File temp;
  5.  
  6. temp = File.createTempFile("temp", Long.toString(System.nanoTime()));
  7.  
  8. if(!(temp.delete()))
  9. {
  10. throw new IOException("Could not delete temp file: " + temp.getAbsolutePath());
  11. }
  12.  
  13. if(!(temp.mkdir()))
  14. {
  15. throw new IOException("Could not create temp directory: " + temp.getAbsolutePath());
  16. }
  17.  
  18. return (temp);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement