Java Temp Directory Get getTempDir()

Here you can find the source of getTempDir()

Description

Return the pathname for the JOA temporary directory that's created when parsing zip files.

License

Open Source License

Return

Pathname

Declaration

public static String getTempDir() 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.*;

public class Main {
    /**/*  ww  w  . j  a v a 2 s . c  om*/
     * Return the pathname for the JOA temporary directory that's created when
     * parsing zip files. Create the directory if necessary.
     * 
     * @return Pathname
     */
    public static String getTempDir() {
        String dir = System.getProperty("user.dir") + File.separator + "temp" + File.separator;

        // test to see if it exists
        File tdir = new File(dir);
        if (!tdir.exists()) {
            tdir.mkdir();
        }
        return dir;
    }
}

Related

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