How do I get operating system temporary directory / folder?

Category: java.lang, viewed: 15589 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);
    }
}
Click here to lend your support to: Kode Java Org and make a donation at www.pledgie.com !

 

Can't find what you are looking for? Join our FORUMS and ask some questions!
Download Hundreds of Complimentary Industry Resources

Get hundreds of popular Industry magazines, white papers, webinars, podcasts, and more; all available at no cost to you. With more than 600 complimentary offers, you'll find plenty of titles to suit your professional interests and needs. Click Here and Sign up today!

Sponsored Links

Our Friends

Statistics

Locations of visitors to this page
visitor stats