(non-PHPdoc)

@param \SplFileInfo $archive The archive object

@return bool
@see \AppserverIo\Appserver\Core\Interfaces\ExtractorInterface::isUndeployable()
347023
public function isUndeployable(\SplFileInfo $archive)
    {

        // make sure that NO flag for the archive is available
        foreach ($this->getFlags() as $flag) {
            if (file_exists($archive->getPathname() . $flag)) {
                return false;
            }
        }

        // it's undeployable if NOT marker file exists
        return true;
    }
664246
protected function _canBeDeleted($path)
    {
        if (!file_exists($path) || !is_dir($path)) {
            $this->err(__d('installer', "Plugin's directory was not found: ", $path));

            return false;
        }

        $folder = new Folder($path);
        $content = $folder->tree();
        $notWritable = [];

        foreach ($content as $foldersOrFiles) {
            foreach ($foldersOrFiles as $element) {
                if (!is_writable($element)) {
                    $notWritable[] = $element;
                }
            }
        }

        if (!empty($notWritable)) {
            $this->err(__d('installer', "Some plugin's files or directories cannot be removed from your server:"));
            foreach ($notWritable as $path) {
                $this->err(__d('installer', "  -{0}", $path));
            }

            return false;
        }

        return true;
    }
1317728
public function isAvailable()
    {
        $isDebugging = $this->_logger->isHandling(ehough_epilog_Logger::DEBUG);

        if (! function_exists('fopen')) {

            if ($isDebugging) {

                $this->_logger->debug('fopen() is not available.');
            }

            return false;
        }

        if (function_exists('ini_get') && ini_get('allow_url_fopen') != true) {

            if ($isDebugging) {

                $this->_logger->debug('allow_url_fopen is set to false.');
            }

            return false;
        }

        return true;
    }
851919
public function isFileAllowed($filePath)
    {
        $filePath = realpath($filePath);
        foreach ($this->allowedImageFolders as $key => $nextFolder) {
            if (0 === strpos($filePath, $nextFolder)) {
                return $key;
            }
        }

        return false;
    }
1154302
public function extract($archive, $destination)
	{
		if (!is_file($archive))
		{
			throw new \RuntimeException('Archive does not exist');
		}

		if ($this->hasNativeSupport())
		{
			return $this->extractNative($archive, $destination);
		}
		else
		{
			return $this->extractCustom($archive, $destination);
		}
	}
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;
        }
    }
1000075
protected function isUploadModuleAvailable()
    {
        if ($this->isUploadModuleAvailable === null) {
            $this->isUploadModuleAvailable =    false !== $this->getUploadModule()
                                            &&  app()->bound(FileRepositoryInterface::class);
        }

        return $this->isUploadModuleAvailable;
    }
1187324
public function isAvailable(): bool
    {
        if (!file_exists("{$this->projectRootDir}/config/bundles.php")) {
            return false;
        }
        $sourcePath = "{$this->packageInstallDir}/.installer/%s/bundles.php";
        foreach ($this->projectType->getProjectDirs() as $projectDir) {
            $bundleFile = sprintf($sourcePath, $projectDir);
            if (is_file($bundleFile)) {
                return true;
            }
        }

        return false;
    }
894017
protected function canDelete($record)
	{
		if (empty($record->id) || $record->published != -2)
		{
			return false;
		}

		return JFactory::getUser()->authorise('core.delete', $record->extension . '.category.' . (int) $record->id);
	}
1026461
public function stop()
    {
        if ($this->isDeleted) {
            // TODO: throw an logic error about not being able to stop an archive thats deleted
        }

        $archiveData = $this->client->stopArchive($this->data['id']);

        try {
            Validators::validateArchiveData($archiveData);
        } catch (InvalidArgumentException $e) {
            throw new ArchiveUnexpectedValueException('The archive JSON returned after stopping was not valid', null, $e);
        }

        $this->data = $archiveData;
        return $this;
    }
1174813
public function removeZip(Zip $zip): bool {

        $archive_key = array_search($zip, $this->zip_archives, true);
        if ( $archive_key === false ) {
            throw new ZipException("Archive not found");
        }

        unset($this->zip_archives[$archive_key]);
        return true;

    }
1017301
public function canDeploy($member = null) {
		if(!$member) $member = Member::currentUser();
		if(!$member) return false; // Must be logged in to check permissions

		if(Permission::checkMember($member, 'ADMIN')) return true;

		return $this->Deployers()->byID($member->ID)
			|| $member->inGroups($this->DeployerGroups());
	}
1003832
private function extract($extractPath, $archive)
    {
        $res = $archive->extractTo($extractPath);
        $archive->close();
        $this->setExtractPath($extractPath);
        $resolver = new Resolver($extractPath);
        $this->data = $resolver->resolve();
    }
829182
public function extractArchive(File $file, ArchiverInterface $archiver)
    {
        $archiver->open($file->getPathname());

        $extractpath = dirname($archiver->getArchivePath()) . DS . uniqid();

        $archiver->extract($extractpath);

        /** @var \DirectoryIterator $item */
        foreach (new \DirectoryIterator($extractpath) as $item) {
            if (!$item->isDot() && $item->isFile()) {
                $file = new File($item->getPathname());

                break;
            }
        }

        return $file;
    }
964141
public function getArchived()
    {
        if (!$this->isArchivable()) {
            return false;
        }
        if (empty($this->owner->{$this->archiveField})) {
            return false;
        }

        return true;
    }
924227
public static function cleanUpDir(\SplFileInfo $dir, $alsoRemoveFiles = true)
    {

        // first check if the directory exists, if not return immediately
        if ($dir->isDir() === false) {
            return;
        }

        // remove old archive from webapps folder recursively
        $files = new \RecursiveIteratorIterator(
            new \RecursiveDirectoryIterator($dir->getPathname()),
            \RecursiveIteratorIterator::CHILD_FIRST
        );

        foreach ($files as $file) {
            // skip . and .. dirs
            if ($file->getFilename() === '.' || $file->getFilename() === '..') {
                continue;
            }
            if ($file->isDir()) {
                @rmdir($file->getRealPath());
            } elseif ($file->isFile() && $alsoRemoveFiles) {
                unlink($file->getRealPath());
            } else {
                // do nothing, because file should NOT be deleted obviously
            }
        }
    }
884027
public function isEnabled()
    {
        $path = $this->directory.'/'.self::FLAG_FILENAME;
        return (bool)$this->pathHelper->getPublicPath($path);
    }