Adds a new storage directory

@param string 		$key
@param string 		$path
@param string 		$url

@return void
344202
public static function add( $key, $path, $url = null )
	{
		static::$paths[$key] = $path;
		
		if ( !is_null( $url ) )
		{
			static::$urls[$key] = $url;
		}
	}
311545
public function addPath($path, $clearCache = true, $group = '__DEFAULT__')
	{
		//var_dump(func_get_args());
		$path = $this->normalizePath($path);

		// This is done for easy reference and
		// eliminates the need to check for doubles
		$this->paths[$group][$path] = $path;

		if ($clearCache)
		{
			$this->cache = [];
		}
	}
290686
protected function ensureDirectory(string $path)
    {
        if (! is_dir($path)) {
            $umask = umask(0);
            @mkdir($path, $this->permissions['dir']['public'], true);
            umask($umask);

            if (! is_dir($path)) {
                throw new FileSystemException($path, 'Unable to create "%s" directory');
            }
        }

        if (! is_readable($path)) {
            throw new FileSystemException($path, 'Unable to access "%s" directory');
        }
    }
1021596
public function insert( $key_path, $value ) {
		try {
			$this->update( $key_path, $value );
		} catch ( NonExistentKeyException $exception ) {
			$exception->get_traverser()->create_key();
			$this->insert( $key_path, $value );
		}
	}
796236
function addPath($path, $prepend = false)
    {
        $this->write(tap($this->read(), function (&$config) use ($path, $prepend) {
            $method = $prepend ? 'prepend' : 'push';

            $config['paths'] = collect($config['paths'])->{$method}($path)->unique()->all();
        }));
    }
851771
protected function createCacheDirectory($path)
	{
		try
		{
			$this->files->makeDirectory(dirname($path), 0777, true, true);
		}
		catch (Exception $e)
		{
			//
		}
	}
1106845
private static void addDir(String path, ZipOutputStream out) throws UtilException {
		path = StrUtil.addSuffixIfNot(path, StrUtil.SLASH);
		try {
			out.putNextEntry(new ZipEntry(path));
		} catch (IOException e) {
			throw new UtilException(e);
		} finally {
			closeEntry(out);
		}
	}
1020158
public function file($key, $path=null) :self {
		// if we have an array of data
		if(is_array($key)) {
			// for each of those
			foreach($key as $index => $path) {
				// set them
				$this->file($index, $path);
			}
		}
		else {
			// add to the list of files
			$this->data[$key] = '@'.$path;
		}
		// return self
		return $this;
	}
643767
private static void addFolderToZip(String path, File folder, ZipOutputStream zos) throws IOException {
        String currentPath = StringUtils.isNotEmpty(path)? path + "/" + folder.getName(): folder.getName();

        for (File file : folder.listFiles()) {
            if (file.isDirectory()) {
                addFolderToZip(currentPath, file, zos);
            } else {
                addFileToZip(currentPath, file, zos);
            }
        }
    }
853940
public function addDir($pathname, $localname = null)
    {
        // Use Recursive functions
        $iterator = new RecursiveIteratorIterator(
            new RecursiveDirectoryIterator($pathname),
            RecursiveIteratorIterator::SELF_FIRST
        );

        foreach ($iterator as $item) {
            // Skip dots
            if ($iterator->isDot()) {
                continue;
            }

            // Add to archive
            if ($item->isDir()) {
                $this->zipArchive->addEmptyDir(
                    $localname . DIRECTORY_SEPARATOR . $iterator->getSubPathName()
                );
            } else {
                $this->zipArchive->addFile(
                    $item->getPathname(),
                    $localname . DIRECTORY_SEPARATOR . $iterator->getSubPathName()
                );
            }
        }
    }
1272937
private void addToZip(String path, Entry entry, ZipOutputStream zos) throws IOException {
        String name = (path.endsWith("/") ? path : path + "/") + entry.getName();
        if (entry.isDirectory()) {
            log.debug("Adding directory to zip: " + name);

            zos.putNextEntry(new ZipEntry(name.endsWith("/") ? name : name + "/"));
            for (Entry child : entry.getEntries()) {
                if (!StringUtils.hasText(path)) {
                    addToZip(entry.getName(), child, zos);
                } else {
                    addToZip(name, child, zos);
                }
            }
            zos.closeEntry();
        } else {
            log.debug("Adding file to zip: " + name);

            zos.putNextEntry(new ZipEntry(name));
            zos.write(entry.getContent());
            zos.closeEntry();
        }
    }
1052042
void createDirectory(Path path) throws IOException {
		if (Files.exists(path) && Files.isDirectory(path)) {
			return;
		}

		if (this.readOnly) {
			throw new FileNotFoundException(
					"The requested directory \""
							+ path.toString()
							+ "\" does not exist and we are in read-only mode, so it cannot be created.");
		}

		Files.createDirectory(path);
	}
631202
def put_content(self, url, content):
        
        cache_path = self._url_to_path(url)

        # Ensure that cache directories exist
        try:
            dir = os.path.dirname(cache_path)
            os.makedirs(dir)
        except OSError as e:
            if e.errno != errno.EEXIST:
                raise Error('Failed to create cache directories for ' % cache_path)

        try:
            with open(cache_path, 'wb') as f:
                f.write(content)
        except IOError:
            raise Error('Failed to cache content as %s for %s' % (cache_path, url))
448280
public static function namespace($key, $path){
        if(!array_key_exists($key, self::$namespaces))
            self::$namespaces[$key] = $path;
    }
124798
public function upload($file, $key)
    {
        if (! $file || ! $this->isValidKey($key))
            return;

        $fileName = $file->getClientOriginalName();
        $pathinfo = pathinfo($fileName);

        $this->deleteStored($key);

        Storage::putFileAs($this->getStoragePath(), $file, $key . '.' . $pathinfo['extension']);
    }
1208476
public function uploadByUrl($url, $key = null, $bucket = '')
    {
        $filePath = tempnam(sys_get_temp_dir(), 'QN');
        copy($url, $filePath);
        $result = $this->uploadFile($filePath, $key, $bucket);
        unlink($filePath);
        return $result;
    }
1354174
public function mkdir($url, $mode, $options)
  {
    $partition = self::getPartition($url);
    $path = self::getRelativePath($url);

    return !!$partition->makeDirectory($path, $mode, $options);
  }