@param string $container
@param string $name
@param bool   $noCheck

@throws \DreamFactory\Core\Exceptions\DfException
973355
public function deleteBlob($container, $name, $noCheck = false)
    {
        try {
            $cursor = $this->gridFindOne($name);
            $this->deleteByObjectId($cursor->_id);
        } catch (ConnectionTimeoutException $ex) {
            throw new ConnectionTimeoutException($ex->getMessage());
        } catch (\Exception $ex) {
            throw new NotFoundException('Failed to delete GridFS file "' . $name . '": ' . $ex->getMessage());
        }
    }
98921
public function setCheckboxName($name)
    {
        $this->_checkboxHiddenField = new Kwf_Form_Container_FieldSet_Hidden($name);
        $this->fields->add($this->_checkboxHiddenField);
        return $this;
    }
1010368
public void register(String name, HealthCheck healthCheck) {
        HealthCheck registered;
        synchronized (lock) {
            if (healthChecks.containsKey(name)) {
                throw new IllegalArgumentException("A health check named " + name + " already exists");
            }
            registered = healthCheck;
            if (healthCheck.getClass().isAnnotationPresent(Async.class)) {
                registered = new AsyncHealthCheckDecorator(healthCheck, asyncExecutorService);
            }
            healthChecks.put(name, registered);
        }
        onHealthCheckAdded(name, registered);
    }
760379
protected function addCheck($name, $type, $args)
    {
        $func = $type.'Check';

        if (method_exists($this, $func)) {
            $type = strtolower(str_replace($type, '', $name));
            $this->$func($type, $name, $args);
        } else {
          throw new \InvalidArgumentException('Invalid check type: '.$type);
        }
    }
529709
public function checkContainerForWrite($container)
    {
        $container = static::addContainerToName($container, '');
        if (!is_dir($container)) {
            if (!mkdir($container, 0777, true)) {
                throw new InternalServerErrorException('Failed to create container.');
            }
        }
    }
283606
public function deleteFile($container, $path, $noCheck = false)
    {
        $file = static::addContainerToName($container, $path);
        if (!$noCheck && !is_file($file)) {
            throw new NotFoundException("File '$file' was not found.");
        }
        if (!unlink($file)) {
            throw new InternalServerErrorException('Failed to delete file.');
        }
    }
770833
public function getBlobAsFile($container = '', $name = '', $localFileName = null)
    {
        $this->checkConnection();
        try {
            /** @var Container $container */
            $container = $this->blobConn->getContainer($container);
            if (empty($container)) {
                throw new \Exception("No container named '$container'");
            }

            $obj = $container->DataObject($name);

            if (!$obj->SaveToFilename($localFileName)) {
                throw new \Exception('');
            }
        } catch (\Exception $ex) {
            static::handleGuzzleException($ex);
            throw new DfException("Failed to retrieve blob '$name': " . $ex->getMessage());
        }
    }
580859
protected function check(string $name, string $check = ''): bool
    {
        return Arr::get($this->keyMap, "{$name}.checksum") === $this->generateNewChecksum($check);
    }
512558
protected function generateCheckboxByGroup($id, $label, $name, $checked, array $options)
    {
        $identifier = \sprintf('%s_%s', $name, $id);
        $key = \sprintf('%s[]', $name);
        $active = \in_array($id, (array) $checked);

        $options['id'] = $identifier;

        $control = $this->checkbox($key, $id, $active, $options);

        $label = $this->label($identifier, $label);

        return \implode(' ', [$control, $label]);
    }
48791
public function addCheck(Check $check)
    {
        if ($this->hasCheck($check->getName())) {
            throw SchemaException::tableCheckAlreadyExists($this->getName(), $check->getName());
        }

        $this->checks[$check->getName()] = $check;
    }
325088
public function containerExists($container = '')
    {
        $this->checkConnection();

        try {
            /** @var Container $container */
            $container = $this->blobConn->getContainer($container);

            return !empty($container);
        } catch (\Exception $ex) {
            if ($ex instanceof ClientErrorResponseException) {
                if ($ex->getCode() === 404 || str_contains($ex->getMessage(), '404')) {
                    return false;
                }
            }
            static::handleGuzzleException($ex);
            throw new DfException('Failed to list containers: ' . $ex->getMessage());
        }
    }
390896
public function moveFile($container, $path, $local_path, $check_exist = true)
    {
        // does local file exist?
        if (!file_exists($local_path)) {
            throw new NotFoundException("File '$local_path' does not exist.");
        }
        // does this file already exist?
        if ($this->fileExists($container, $path)) {
            if (($check_exist)) {
                throw new BadRequestException("File '$path' already exists.");
            }
        }
        // does this file's parent folder exist?
        $parent = FileUtilities::getParentFolder($path);
        if (!empty($parent) && (!$this->folderExists($container, $parent))) {
            throw new NotFoundException("Folder '$parent' does not exist.");
        }

        // create the file
        $this->checkContainerForWrite($container); // need to be able to write to storage
        $file = static::addContainerToName($container, $path);
        if (!rename($local_path, $file)) {
            throw new InternalServerErrorException("Failed to move file '$path'");
        }
    }
498158
public function startHashElement($name)
    {
        $this->checkStartHashElement($name);

        $this->isEmpty = false;

        $object = new Json\JsonObject($this->json);

        if ($this->json instanceof Json\ArrayObject) {
            $this->json[] = $object;
            $this->json = $object;
        } else {
            $this->json->$name = $object;
            $this->json = $object;
        }
    }
899322
public function startHashElement($name)
    {
        $this->checkStartHashElement($name);

        $this->isEmpty = false;

        $this->xmlWriter->startElement($name);
    }
665172
public function dropCheck($name)
    {
        if (!$this->hasCheck($name)) {
            throw SchemaException::tableCheckDoesNotExist($this->getName(), $name);
        }

        unset($this->checks[$name]);
    }
755515
public function checkWithValue($name, $value)
    {
        /** @var \Behat\Mink\Element\NodeElement $nodeElement */
        $nodeElement = $this->getSession()->getPage()->find(
            'xpath',
            sprintf(
                '//input[@type="checkbox" and @name="%s" and @value="%s"]',
                $name,
                $value
            )
        );

        if (null === $nodeElement) {
            // Yikes! It aint where we want it
            throw new ExpectationException(
                sprintf(
                    'A checkbox with the value "%s" is not in the page.',
                    $value
                ),
                $this->getSession()->getDriver()
            );
        }

        // Make the magic happen
        $nodeElement->check();
    }
380959
protected function check($name, $check = '')
    {
        if (!isset($this->keyMap[$name])) {
            return false;
        }
        return ($this->keyMap[$name]['checksum'] === $this->generateNewChecksum($check));
    }