Java Temp Directory Get getTempDir()

Here you can find the source of getTempDir()

Description

get Temp Dir

License

Open Source License

Declaration

public static String getTempDir() 

Method Source Code


//package com.java2s;

import java.io.File;

public class Main {
    public static String getTempDir() {
        String defaultTmpDir = System.getProperty("java.io.tmpdir");
        if (defaultTmpDir != null && new File(defaultTmpDir).exists()) {
            return defaultTmpDir;
        } else {//from   w  w w. ja v a2  s. com
            return System.getProperty("user.home");
        }
    }
}

Related

  1. getTempDir()
  2. getTempDir()
  3. getTempDir()
  4. getTempDir()
  5. getTempDir()
  6. getTempDir()
  7. getTempDir()
  8. getTempDir()
  9. getTempDir()