Java Utililty Methods Temp Directory Get

List of utility methods to do Temp Directory Get

Description

The list of methods to do Temp Directory Get are organized into topic(s).

Method

StringgetTempDir()
Get the temp dir.
String dir = System.getProperty("torgo.temp");
if (dir == null) {
    dir = System.getProperty("java.io.tmpdir");
return dir;
StringgetTempDir()
get Temp Dir
return System.getProperty("java.io.tmpdir") + "/build_" + Long.toString(System.nanoTime());
FilegetTempDir()
Creates and returns a new randomly named temporary directory.
File file = new File(System.getProperty("java.io.tmpdir"), TEMP_DIR_PREFIX + RANDOM.nextInt(10000000));
if (!file.mkdirs()) {
    throw new RuntimeException("could not create temp directory: " + file.getAbsolutePath());
file.deleteOnExit();
return file;
FilegetTempDir()
get Temp Dir
String temp = System.getProperty("java.io.tmpdir");
System.out.println("OS current temporary directory is " + temp);
if (null == temp) {
    return new File("/tmp");
return new File(temp);
FilegetTempDir()
This method is NOT intended as a part of public API and should not be used outside the library!
return new File(System.getProperty("java.io.tmpdir"));
StringgetTempDir()
Return the pathname for the JOA temporary directory that's created when parsing zip files.
String dir = System.getProperty("user.dir") + File.separator + "temp" + File.separator;
File tdir = new File(dir);
if (!tdir.exists()) {
    tdir.mkdir();
return dir;
StringgetTempDir()
Returns the temp directory for this machine.
String tempDir = System.getProperty("java.io.tmpdir");
if (!tempDir.endsWith(java.io.File.separator))
    tempDir += java.io.File.separator;
return tempDir;
FilegetTempDir()
Get temporary director
String tmpdir = System.getProperty("java.io.tmpdir");
return new File(tmpdir);
StringgetTempDir()
get Temp Dir
String s = null;
try {
    File f = File.createTempFile("orbit", null);
    s = f.getParentFile().getAbsolutePath();
    f.delete();
} catch (Exception e) {
    e.printStackTrace();
return s;
StringgetTempDir()
Returns system temp dir.
return System.getProperty(TEMP_DIR);