Retrieve the temporary directory where to store/load payloads

@param payload The payload to retrieve the temp directory
@return The temp directory, new one if the directory does not exist
431078
private File getTmpDir(RoxPayload payload) {
		File tmpDir = new File(configuration.getWorkspace() + "/tmp/" + payload.getVersion());
		
		if (!tmpDir.exists()) {
			tmpDir.mkdirs();
		}
		
		return tmpDir;
	}
575155
def tempDir(self):
        
        if self._tempDir is None:
            self._tempDir = self._fileStore.getLocalTempDir()
        return self._tempDir
524945
public StorageDir getDir(BlockStoreLocation location) {
    if (location.equals(BlockStoreLocation.anyTier())
        || location.equals(BlockStoreLocation.anyDirInTier(location.tierAlias()))) {
      throw new IllegalArgumentException(
          ExceptionMessage.GET_DIR_FROM_NON_SPECIFIC_LOCATION.getMessage(location));
    }
    return getTier(location.tierAlias()).getDir(location.dir());
  }
416182
def get_dir(self, objtxt):
        """"""
        obj, valid = self._eval(objtxt)
        if valid:
            return getobjdir(obj)
712401
def _getTempSharedDir(self):
        
        tempDir = self.tempFilesDir
        for i in range(self.levels):
            tempDir = os.path.join(tempDir, random.choice(self.validDirs))
            if not os.path.exists(tempDir):
                try:
                    os.mkdir(tempDir)
                except os.error:
                    if not os.path.exists(tempDir): # In the case that a collision occurs and
                        # it is created while we wait then we ignore
                        raise
        return tempDir
280125
public static <Payload> Message<Payload> create(Payload payload) {
    return new Message<>(payload, HashTreePMap.empty());
  }
123924
def tmppath(path=None, include_unix_username=True):
    
    addon = "luigitemp-%08d" % random.randrange(1e9)
    temp_dir = '/tmp'  # default tmp dir if none is specified in config

    # 1. Figure out to which temporary directory to place
    configured_hdfs_tmp_dir = hdfs().tmp_dir
    if configured_hdfs_tmp_dir is not None:
        # config is superior
        base_dir = configured_hdfs_tmp_dir
    elif path is not None:
        # need to copy correct schema and network location
        parsed = urlparse(path)
        base_dir = urlunparse((parsed.scheme, parsed.netloc, temp_dir, '', '', ''))
    else:
        # just system temporary directory
        base_dir = temp_dir

    # 2. Figure out what to place
    if path is not None:
        if path.startswith(temp_dir + '/'):
            # Not 100%, but some protection from directories like /tmp/tmp/file
            subdir = path[len(temp_dir):]
        else:
            # Protection from /tmp/hdfs:/dir/file
            parsed = urlparse(path)
            subdir = parsed.path
        subdir = subdir.lstrip('/') + '-'
    else:
        # just return any random temporary location
        subdir = ''

    if include_unix_username:
        subdir = os.path.join(getpass.getuser(), subdir)

    return os.path.join(base_dir, subdir + addon)
488551
public RFuture<String> get(String url) {
    return req(url).execute().map(GET_PAYLOAD);
  }
329894
def get_tmpdir():
    
    global __tmpdir
    if __tmpdir is not None:
        return __tmpdir

    __tmpdir = tempfile.mkdtemp(prefix='.tmp.glerbl.', dir=".")
    atexit.register(__clean_tmpdir)

    return __tmpdir
456022
public static TemporaryFiles get(Application app) {
		TemporaryFiles instance = app.getInstance(TemporaryFiles.class);
		if (instance == null) {
			File dir = null;
			String path = app.getProperty(Application.PROPERTY_TMP_DIRECTORY);
			if (path != null) {
				dir = new File(path);
				if (!dir.exists())
					if (!dir.mkdirs())
						dir = null;
			}
			if (dir == null) {
				path = app.getProperty("java.io.tmpdir");
				if (path != null) {
					dir = new File(path);
					if (!dir.exists())
						if (!dir.mkdirs())
							dir = null;
				}
			}
			instance = new TemporaryFiles(/*app, */dir);
		}
		return instance;
	}
330328
public TempBlockMeta getTempBlockMetaOrNull(long blockId) {
    for (StorageTier tier : mTiers) {
      for (StorageDir dir : tier.getStorageDirs()) {
        if (dir.hasTempBlockMeta(blockId)) {
          return dir.getTempBlockMeta(blockId);
        }
      }
    }
    return null;
  }
701480
public String getBaseDirectory(String path) {
    if (path != null) {
      int finishIndex = path.indexOf(HADOOP_TEMPORARY);
      if (finishIndex > 0) {
        String newPath = path.substring(0, finishIndex);
        if (newPath.endsWith("/")) {
          return newPath.substring(0, newPath.length() - 1);
        }
        return newPath;
      }
    }
    return path;
  }
194432
public static String getTempDir() {
        synchronized (FileUtil.class) {
            if (TEMP_DIR == null) {
                // Get the 'java.io.tmpdir' property
                String tmpDir = System.getProperty("java.io.tmpdir");

                if (StringUtil.isEmpty(tmpDir)) {
                    // Stupid fallback...
                    // TODO: Delegate to FileSystem?
                    if (new File("/temp").exists()) {
                        tmpDir = "/temp";  // Windows
                    }
                    else {
                        tmpDir = "/tmp";   // Unix
                    }
                }
                TEMP_DIR = tmpDir;
            }
        }
        return TEMP_DIR;
    }
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);
        }
    }
1248147
private static File getFax4jInternalTemporaryDirectoryImpl()
    {
        File temporaryFile=null;
        try
        {
            //create temporary file
            temporaryFile=File.createTempFile("temp_",".temp");
        }
        catch(IOException exception)
        {
            throw new FaxException("Unable to create temporary file.",exception);
        }
        
        //get parent directory
        File temporaryDirectory=temporaryFile.getParentFile();
        
        //delete file
        boolean deleted=temporaryFile.delete();
        if(!deleted)
        {
            temporaryFile.deleteOnExit();
        }

        //read properties
        Properties properties=LibraryConfigurationLoader.readInternalConfiguration();

        //get values
        String name=properties.getProperty("org.fax4j.product.name");
        String version=properties.getProperty("org.fax4j.product.version");

        //create sub directory
        File fax4jTemporaryDirectory=new File(temporaryDirectory,name+"_"+version);
        if(!fax4jTemporaryDirectory.exists())
        {
            boolean created=fax4jTemporaryDirectory.mkdirs();
            if(!created)
            {
                throw new FaxException("Unable to create fax4j internal temporary directory: "+fax4jTemporaryDirectory);
            }
        }

        return fax4jTemporaryDirectory;
    }
745771
def temporary_object_path(self, name):
        
        return os.path.join(self._path, self.TMP_OBJ_DIR, name)