Get file path

@param string $key
@param string $file

@return string
506375
public function getFile(string $key, string $file) : string
    {
        return $this->getDirectory($key) . '/' . $file;
    }
1314733
public function realpath($file)
    {
        $prefix = preg_quote($this->_prefix, '~');
        $file = preg_replace("~^{$prefix}~", '', $file);
        if (!$this->_hasVolume) {
            return $file;
        }
        if (preg_match('~^[A-Z]+:~', $file)) {
            return $file;
        }
        $file = ltrim($file, DS);
        $pos = strpos($file, DS);
        if ($pos !== false) {
            $file = substr_replace($file, ':' . DS, $pos, 1);
        }
        return $file;
    }
1357988
protected function getPath($file = null)
    {
        $path = Configure::readOrFail('Thumber.target');

        return $file ? $path . DS . $file : $path;
    }
149626
def _get_key_file_path():
        """"""
        if os.getenv(USER_HOME) is not None and os.access(os.getenv(USER_HOME),
                                                          os.W_OK):
            return os.path.join(os.getenv(USER_HOME), KEY_FILE_NAME)

        return os.path.join(os.getcwd(), KEY_FILE_NAME)
136050
public function getImagePath($file, $admin = false)
    {
        return $this->getDir($file, $this->_sImageDir, $admin);
    }
891448
private function _getFilePath($pKey)
    {
        $keyArr   = explode(static::SECTION_DELIMITER, $pKey, 2);
        $fileName = $keyArr[0];

        if (! isset($this->_paths[$fileName])) {
            $encodedFileName         = md5($fileName);
            $this->_paths[$fileName] = $this->_dir
                                     . FileData::getSubPath($encodedFileName, self::SUB_DIRS)
                                     . $encodedFileName
                                     . self::AGL_VAR_CACHE_EXT;
        }

        $this->_paths[$pKey] = $this->_paths[$fileName];

        return $this->_paths[$fileName];
    }
1338519
protected function findFile($file)
    {
        foreach (clone $this->paths as $path) {
            $filePath = $path . '/' . $file;

            if (is_file($filePath)) {
                return $filePath;
            }
        }

        return false;
    }
307968
public static function url( $file = null, $key = null ) 
	{
		// get the storage key
		if ( is_null( $key ) ) 
		{
			$key = static::$default;
		}

		// check if path exists
		if ( !isset( static::$urls[$key] ) ) 
		{
			throw new CCException( 'CCStorage - use of undefined public url '.$key.'.' );
		}

		return CCUrl::to( static::$urls[$key].$file );
	}
544777
public function getFiles($key = null)
    {
        if ($key === null) {
            return $this->files;
        } else {
            return (isset($this->files[$key])) ? $this->files[$key] : null;
        }
    }
33439
private function getExamplePathFromSource(string $file): string
    {
        return sprintf(
            '%s%s%s',
            trim($this->getSourceDirectory(), '\\/'),
            DIRECTORY_SEPARATOR,
            trim($file, '"')
        );
    }
1229745
public function pathToFile($file, $locale): string
    {
        return resource_path('lang'.DIRECTORY_SEPARATOR.(is_a($locale, Locale::class) ? $locale->iso6391() : $locale).DIRECTORY_SEPARATOR.$file.'.php');
    }
497962
protected static function optimizeGet(string $key, $file = null)
    {
        $object = self::$__optimizeInstance ?? self::optimizeInstance();
        $prefix = static::$__prefix ? static::$__prefix . '|' . static::class : static::class;

        return $object->get($prefix, $key, $file);
    }
1224225
protected function getFilename($key): string
    {
        $id = $this->keyToId($key);
        $generator = $this->getFilenameOption();

        return $this->cacheDir . DIRECTORY_SEPARATOR . $generator($id);
    }
1207294
public function file($key = null)
    {
        if ($key) {

            if (isset($_FILES[$key])) {
                return $_FILES[$key];
            }

            throw new \InvalidArgumentException(sprintf(
                '%s ist not a valid key for $_FILES', $key
            ));

        }

        return $_FILES;
    }
522259
public function get($key)
    {
        $filePath = $this->storageFolder . $key;
        if (file_exists($filePath)) {
            return file_get_contents($filePath);
        }

        return null;
    }
468757
public function getFile($key)
    {
        if (isset($this->files[$key])) {
            return $this->files[$key];
        }

        return null;
    }
1148534
public function get_path($file) {
		$parts = str_split($file['md5sum'], 2);
		$subpath = $parts[0] . '/' . $parts[1] . '/' . $parts[2] . '/';

		$path = $subpath . $file['id'] . '-' . $this->sanitize_filename($file['name']);

		return $path;
	}