How do I get operating system temporary directory / folder?

Bookmark this example!  
Category: java.lang, viewed: 1796 time(s).
 
package org.kodejava.example.java.lang;
 
public class TempDirExample 
{
    public static void main(String[] args)
    {
        // This is the property name for accessing OS temporary directory or
        // folder.
        String property = "java.io.tmpdir";
        
        // Get the temporary directory and print it.
        String tempDir = System.getProperty(property);
        System.out.println("OS current temporary directory is " + tempDir);
    }
}
 
 
Can't find what you are looking for? Join our FORUMS and ask some questions!

Most Viewed Examples

Latest Code Examples

100 Top & Latest


Locations of visitors to this page
eXTReMe Tracker
visitor stats
Get Chitika Premium