Return the temp folder File object or null if the path does not exist
489177
private File getTempFolder(String tempPath) {
        if (tempPath != null) {
            File folder = new File(tempPath);
            if (folder.exists()) {
                return folder;
            }
        }
        return null;
    }
688692
def tempfile(self):
        ""
        tf = tempfile.NamedTemporaryFile()
        tfn = tf.name
        tf.close()
        os.remove(tf.name)
        shutil.copy(self.fn, tfn)
        return tfn
342037
def mktemp_file(self):
        
        if not(os.path.exists(self.__dirname)):
            logging.debug("Creating directory {}".format(self.__dirname))
            os.mkdir(self.__dirname)
        elif not(os.path.isdir(self.__dirname)):
            raise TempDirIsFileException(
                "There is a file called %s in this directory!!!" %
                self.__dirname)
        #self.fdesc, self.fname = tempfile.mkstemp(dir=self.__dirname, text=True)
        self.f = tempfile.NamedTemporaryFile(dir=self.__dirname, delete=False, mode="wt")
        logging.debug("Creating file {}".format(self.f.name))
1301998
def temp_directory(*args, **kwargs):
    

    path = tempfile.mkdtemp(*args, **kwargs)
    try:
        yield path
    finally:
        shutil.rmtree(path)
407174
def temp_file():
    
    fd, path = tempfile.mkstemp()
    os.close(fd)
    try:
        yield path
    finally:
        os.remove(path)
1146040
def link(self):
    """"""
    if not self.IsLink():
      return ''

    location = getattr(self.path_spec, 'location', None)
    if location is None:
      return ''

    return self._file_system.GetDataByPath(location)
1364966
def tempdir():
    """"""
    directory_path = tempfile.mkdtemp()

    def clean_up():  # pylint: disable=missing-docstring
        shutil.rmtree(directory_path, onerror=on_error)

    with cd(directory_path, clean_up):
        yield directory_path
600559
def _get_temp_file_location():
    '''
    

    '''
    from .._connect import main as _glconnect
    unity = _glconnect.get_unity()
    cache_dir = _convert_slashes(unity.get_current_cache_file_location())
    if not _os.path.exists(cache_dir):
        _os.makedirs(cache_dir)
    return cache_dir
541117
public function getTempPath(): string
    {
        $path = $this->getRuntimePath() . DIRECTORY_SEPARATOR . 'temp';
        FileHelper::createDirectory($path);
        return $path;
    }
801096
def temp_path(file_name=None):
    

    if file_name is None:
        file_name = generate_timestamped_string("wtf_temp_file")

    return os.path.join(tempfile.gettempdir(), file_name)
417877
def a_temp_file():
    """"""
    filename = None
    try:
        tmpfile = tempfile.NamedTemporaryFile(delete=False)
        filename = tmpfile.name
        yield tmpfile
    finally:
        if filename and os.path.exists(filename):
            os.remove(filename)
839213
private String getRealPath( String path )
            throws IOException
    {

        URL fileURL = _servletContext.getResource( path );

        File tempDir = (File) _servletContext.getAttribute( "javax.servlet.context.tempdir" );

        // download file into temp dir
        if ( fileURL != null )
        {
            File newFile = File.createTempFile( "temp", ".jar", tempDir );
            if ( download( fileURL, newFile ) )
            {
                String filePath = newFile.getPath();
                return filePath;
            }
        }
        return null;
    }
1105399
private File getFileFromPath(final String path) {
        File result = (path != null) ? new File(path) : null;
        // AS7-1752 see if a non-existent relative path exists relative to the home dir
        if (result != null && homeDir != null && !result.exists() && !result.isAbsolute()) {
            File relative = new File(homeDir, path);
            if (relative.exists()) {
                result = relative;
            }
        }
        return result;
    }
1213319
private synchronized File createTemp(File workingDirectory) throws IOException {
        if (workingDirectory == null) {
            return createTempDir();
        }
        else {
            workingDirectory.mkdirs();
            return workingDirectory;
        }
    }
184834
def gettempdir():
    """"""
    global tempdir
    if tempdir is None:
        _once_lock.acquire()
        try:
            if tempdir is None:
                tempdir = _get_default_tempdir()
        finally:
            _once_lock.release()
    return tempdir
1176237
public static File getTempDir(){
        String p = System.getProperty(ND4JSystemProperties.ND4J_TEMP_DIR_PROPERTY);
        if(p == null || p.isEmpty()){
            return new File(System.getProperty("java.io.tmpdir"));
        } else {
            return new File(p);
        }
    }
711542
private File getNextTempDirectory() throws AnalysisException {
        File directory;

        // getting an exception for some directories not being able to be
        // created; might be because the directory already exists?
        do {
            final int dirCount = DIR_COUNT.incrementAndGet();
            directory = new File(tempFileLocation, String.valueOf(dirCount));
        } while (directory.exists());
        if (!directory.mkdirs()) {
            throw new AnalysisException(String.format(
                    "Unable to create temp directory '%s'.",
                    directory.getAbsolutePath()));
        }
        return directory;
    }