Return if the extractor can extract the requested data or not.

@param $source
@param SupportedTarget $target
@param ExtractionContextInterface $extractionContext
@return boolean
510535
public function canExtract($source, $target, ExtractionContextInterface $extractionContext)
    {
        if (!$target instanceof SupportedTarget) {
            return false;
        }

        if (is_null(self::getPrimitiveType($source))) {
            return false;
        }

        return true;
    }
395852
public static function copy($source, $target)
    {
        if (false === is_dir($source)) {
            return copy($source, $target);
        }

        self::mkdir($target);

        $dirSource = dir($source);

        while (false !== ($fileEntry = $dirSource->read())) {
            if (true === in_array($fileEntry, self::getDirSymbols())) {
                continue;
            }

            if (false === self::copy(sprintf('%s/%s', $source, $fileEntry), sprintf('%s/%s', $target, $fileEntry))) {
                return false;
            }

        }

        $dirSource->close();

        return true;
    }
157214
public function withContext(RelationContext $source, RelationContext $target = null): self
    {
        $definition = clone $this;
        $definition->sourceContext = $source;
        $definition->targetContext = $target;

        return $definition;
    }
141643
public function extract($target)
		{
			if (true === $this->_enabled && !empty($target)) {
				return $this->_zip->extractTo($target);
			}

			return false;
		}
158175
private function copyRecursive($source, $target)
    {
        if (!is_dir($source)) {
            $this->filesystem->ensureDirectoryExists(dirname($target));
            copy($source, $target);

            return;
        }

        $iterator = new \RecursiveIteratorIterator(
            new \RecursiveDirectoryIterator($source, \RecursiveDirectoryIterator::SKIP_DOTS),
            \RecursiveIteratorIterator::SELF_FIRST
        );

        $this->filesystem->ensureDirectoryExists($target);

        foreach ($iterator as $file) {
            $targetPath = $target . DIRECTORY_SEPARATOR . $iterator->getSubPathName();
            if ($file->isDir()) {
                $this->filesystem->ensureDirectoryExists($targetPath);
            } else {
                copy($file->getPathname(), $targetPath);
            }
        }
    }
1303921
public function applyActions(array $actions, $source, $target)
    {
        $applied = 0;
        foreach ($actions as $action_id => $data) {

            $handler = $this->getActionHandler($action_id);

            if (empty($handler)) {
                continue;
            }

            $result = $this->applyAction($source, $target, $handler, $data);

            if ($result === true) {
                $applied++;
            }
        }

        return $applied;
    }
1289729
protected function getKeysForSource(int $sourceId): \Traversable
    {
        $row = $this->getRow($sourceId);
        foreach ($this->extractors as $extractor) {
            switch (true) {
                case $extractor instanceof MultiStringExtractorInterface:
                    foreach ($extractor->keys($row) as $key) {
                        yield $extractor->name() . '.' . $key;
                    }
                    break;
                case $extractor instanceof ExtractorInterface:
                    if ($extractor->supports($row)) {
                        yield $extractor->name();
                    }
                    break;
                default:
                    throw new \InvalidArgumentException('Unknown extractor type ' . \get_class($extractor));
            }
        }
    }
644385
public static void extract(int format, Resource source, Resource target) throws IOException {
	if (format == FORMAT_ZIP) extractZip(source, target);
	else if (format == FORMAT_TAR) extractTar(source, target);
	else if (format == FORMAT_GZIP) extractGZip(source, target);
	else if (format == FORMAT_TGZ) extractTGZ(source, target);
	else throw new IOException("can't extract in given format");
    }
1175401
public function copy($target, $source)
    {
        if (!$this->exists($target)) {
            throw new \RuntimeException("$target does not exist.", E_ERROR);
        }

        if (!$this->exists($source)) {
            $this->makeDirectory(dirname($source), true);
        }

        return file_put_contents($source, $this->get($target));
    }
520572
public function extract($target)
    {
        $relation = $this->_child->find(array(
                $this->_property => $this->_root,
                $this->_target_property => $target,
            ));

        if ($relation) {
            $relation->delete();
        }

        return $relation;
    }
65454
public function translate($source, $target, $text)
    {
        return $this->getResponse($this->getRequest('', $text, $source, $target));
    }
1162143
protected function extractNodeType($targetType, array $source)
    {
        if (isset($source['__nodeType'])) {
            $nodeTypeName = $source['__nodeType'];
        } else {
            $matches = [];
            preg_match(self::EXTRACT_CONTENT_TYPE_PATTERN, $targetType, $matches);
            if (isset($matches['nodeType'])) {
                $nodeTypeName = $matches['nodeType'];
            } else {
                $nodeTypeName = 'unstructured';
            }
        }
        return $this->nodeTypeManager->getNodeType($nodeTypeName);
    }
93718
public function canConvertFrom($source, $targetType)
    {
        return !(
            $this->reflectionService->isClassAnnotatedWith($targetType, Flow\Entity::class) ||
            $this->reflectionService->isClassAnnotatedWith($targetType, Flow\ValueObject::class) ||
            $this->reflectionService->isClassAnnotatedWith($targetType, \Doctrine\ORM\Mapping\Entity::class)
        );
    }
1089560
public function extract($source, $swagger, ExtractionContextInterface $extractionContext)
    {
        if (!$this->canExtract($source, $swagger, $extractionContext)) {
            throw new ExtractionImpossibleException();
        }

        $result = $this->serializer->deserialize($source, get_class($swagger), 'json');

        foreach ($result as $key => $value) {
            $swagger->{$key} = $value;
        }
    }
221309
public function canExtract($source, $target, ExtractionContextInterface $extractionContext)
    {
        if(!$target instanceof Schema) {
            return false;
        }

        if(!$extractionContext->hasParameter('controller-reflection-method')) {
            return false;
        }

        return true;
    }
875669
public function extractImage($source, $target, $start = '00:00:01', $frames = 1)
    {
        $this->serviceLocator->setShared('playgroundcore_phpvideotoolkit', false);
       
        $ffmpeg = $this->serviceLocator->get('playgroundcore_phpvideotoolkit')
            ->addPreInputCommand('-y');

        if (!empty($start)) {
            $ffmpeg->addPreInputCommand('-ss', $start);
        }

        $ffmpeg->addCommand('-i', $source)
            ->addCommand('-vframes', $frames)
            ->setOutputPath($target)
            ->execute();

        return $target;
    }
935014
public static function zipExtract(String $source, String $target = NULL) : Bool
    {
        $source = Info::rpath($source);
        $target = Info::rpath($target);

        $source = Base::suffix($source, '.zip');

        if( ! file_exists($source) )
        {
            throw new Exception\FileNotFoundException(NULL, $source);
        }

        if( empty($target) )
        {
            $target = Extension::remove($source);
        }

        $zip = new ZipArchive;

        if( $zip->open($source) === true )
        {
            $zip->extractTo($target);
            $zip->close();

            return true;
        }
        else
        {
            return false;
        }
    }