tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Tools and Libs > Commons IO > Basic > Various Directory Paths

Various Directory Paths 

Apache Commons IO is a java library with simple IO utilities and filters. This requires the library commons-io-2.1.jar to be in classpath. The following example shows using FileUtils.getTempDirectoryPath() and FileUtils.getUserDirectoryPath() APIs.

File Name  :  
com/bethecoder/tutorials/commons_io/tests/VariousDirPaths.java 
Author  :  Sudhakar KV
Email  :  [email protected]
   
package com.bethecoder.tutorials.commons_io.tests;

import org.apache.commons.io.FileUtils;

public class VariousDirPaths {

  /**
   @param args
   */
  public static void main(String[] args) {
    System.out.println("Temp dir path : " + FileUtils.getTempDirectoryPath());
    System.out.println("User dir path : " + FileUtils.getUserDirectoryPath());
  }
}
   

It gives the following output,
Temp dir path : C:\DOCUME~1\VSUDHA~1\LOCALS~1\Temp\
User dir path : C:\Documents and Settings\vsudhakar001



 
  


  
bl  br