Sets the target of upload.

@param string $target The target of upload

@throws \InvalidArgumentException If the target is not string or empty string
973494
public function set($target)
    {
        if (! is_string($target) || empty($target)) {
            throw new InvalidArgumentException(
                'Invalid target provided. Must be an non-empty string.'
            );
        }
        $this->target = $target;
    }
702807
public function setTarget($target = self::ODMENUTARGET_SELF)
    {
        $targets    = $this->getTargetConstants();
        $target     = (string) $target;
        if (!in_array($target, $targets)) { $target = self::ODMENUTARGET_SELF; }

        $this->target = $target;

        return $this;
    }
866601
public void setTargetFolder(String target) {

        m_targetFolder = target;
        setCaption(Messages.get().key(Messages.GUI_UPLOAD_DIALOG_TITLE_1, m_targetFolder));
    }
326481
protected function setPath($path)
    {
        if ($path !== '' && !$this->isValidPath($path)) {
            throw new \InvalidArgumentException("Invalid path '$path'");
        }
        
        $this->path = (string)$path;
    }
212172
public function setLocation($location)
    {
        if (! is_int($location)) {
            throw new \InvalidArgumentException(
                'Argument 1 must be an int value. Valued passed is of type ' . gettype($location));
        }
        
        $this->location = $location;
    }
957252
public function setTarget($target) {
            
            if(is_array($target)) {
                foreach ($target as $arg) {
                    $this->arguments[] = $arg;
                }
            }
            if(is_string($target)) {
                $args = explode(',', $target);
                foreach ($args as $arg) {
                   $this->arguments[] = $arg; 
                }
            }
            return $this;
        }
763611
public function symlink($target, $link)
    {
        if (!file_exists($target)) {
            throw new \InvalidArgumentException('Target not found: ' . $target);
        }
        if ($this->relative) {
            $target = $this->makePathRelative($target, dirname($link));
        }
        $this->fs->symlink($target, $link, $this->copyOnWindows);
    }
529067
private function setError($error)
	{
		if (!\is_int($error)) {
			throw new InvalidArgumentException('Upload file error status must be an integer');
		}

		if (!\in_array($error, self::$errors, true)) {
			throw new InvalidArgumentException('Invalid error status for UploadedFile');
		}

		$this->error = $error;
	}
231915
public static function remove($target)
    {
        if (is_dir($target)) {
            $files = glob($target . '*', GLOB_MARK);
            foreach ($files as $file) {
                self::remove($file);
            }
            @rmdir($target);
        } else {
            if (is_file($target)) {
                @unlink($target);
            }
        }
    }
680426
public function setTarget($target)
    {
        //Add to route group if any
        if (!$target instanceof \Closure) {
            $groupNamespace = implode('\\', Router::$groupsProps['namespace']);
            $target = $groupNamespace ? "$groupNamespace\\$target" : $target;
        }

        if (!$target instanceof Closure &&
                !preg_match(Router::TARGET_REGEX, $target)) {
            throw new Exception("Invalid target string $target");
        }
        $this->target = $target;

        return $this;
    }
220177
public function copy($target) {
        if (!file_exists(dirname($target)))
            if (!mkdir(dirname($target), 0777, true))
                return false;
        return true;
    }
405641
public function setTarget($target): self
    {
        if (!\is_object($target)) {
            throw new \InvalidArgumentException('The $target should be an object, '.\gettype($target).' given');
        }

        $this->target = $target;

        return $this;
    }
424292
private function mkdir($target)
    {
        if (\is_dir($target)) {
            return;
        }

        if (! $this->file->mkdir($target)) {
            $this->output->writeln("<error>[$target] could not be created. Please check directory permissions.</error>");
        }
    }
172935
public function addTarget(Target $target, string $name = null)
    {
        if ($name === null) {
            $this->_targets[] = $target;
        } else {
            $this->_targets[$name] = $target;
        }
    }
460023
public function setTitle($title)
    {
        if (is_string($title) === true) {
            $this->title = $title;
        } else {
            $msg = "The 'title' argument must be a string, '" . gettype($title) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
365409
public function updateTarget(Target $target): void
    {
        $query = $this->connection->createQueryBuilder();
        $query
            ->update('ngbm_rule_target')
            ->set('rule_id', ':rule_id')
            ->set('type', ':type')
            ->set('value', ':value')
            ->where(
                $query->expr()->eq('id', ':id')
            )
            ->setParameter('id', $target->id, Type::INTEGER)
            ->setParameter('rule_id', $target->ruleId, Type::INTEGER)
            ->setParameter('type', $target->type, Type::STRING)
            ->setParameter('value', $target->value, is_array($target->value) ? Type::JSON_ARRAY : Type::STRING);

        $this->applyStatusCondition($query, $target->status);

        $query->execute();
    }
688004
protected function resolveTargetFilePath($target, $basePath)
    {
        switch (true) {

            // resource
            case strpos($target, '@') === 0:
                $targetPath = $this->fileLocator->locate($target);
                break;

            // kernel related
            case strpos($target, '/') === 0:
                $targetPath = sprintf('%s%s',
                    $this->kernelDir,
                    $target
                );
                break;

            // related file
            default:
                $targetPath = sprintf('%s/%s', $basePath, $target);
                break;
        }

        if (!is_writable($targetPath)) {
            throw new \InvalidArgumentException(sprintf(
                'Unable to resolve "%s" target, resolved into "%s" file path which is not writable.',
                $target,
                $targetPath
            ));
        }

        return $targetPath;
    }