tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Tools and Libs > Google Guava > IO > Temp Directory

Temp Directory 

Google Guava is a java library with lot of utilities and reusable components. This requires the library guava-10.0.jar to be in classpath. The following example shows using Files.createTempDir() API.

File Name  :  
com/bethecoder/tutorials/guava/io_tests/TempDirTest.java 
Author  :  Sudhakar KV
Email  :  [email protected]
   
package com.bethecoder.tutorials.guava.io_tests;

import java.io.File;
import java.io.IOException;

import com.google.common.io.Files;

public class TempDirTest {

  /**
   @param args
   @throws IOException 
   */
  public static void main(String[] argsthrows IOException {
    File tmpDir = Files.createTempDir();
    System.out.println(tmpDir);
  }

}
   

It gives the following output,
C:\DOCUME~1\VSUDHA~1\LOCALS~1\Temp\1321996559515-0



 
  


  
bl  br