Retrives the list of files and folders under the specified folder.
Use empty string to specify root folder.

@param string $strFolder The name of folder.
@param string $storageName The name of storage.

@return array
518989
public function getFilesList($strFolder, $storageName = '')
    {
        //build URI
        $strURI = $this->strURIFolder;
        //check whether file is set or not
        if (!$strFolder == '') {
            $strURI .= $strFolder;
        }
        if ($storageName != '') {
            $strURI .= '?storage=' . $storageName;
        }

        //sign URI
        $signedURI = Utils::sign($strURI);

        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');

        $json = json_decode($responseStream);

        return $json->Files;
    }
1315403
public function getFile($fileName, $storageName = '')
    {
        //check whether file is set or not
        if ($fileName == '') {
            AsposeApp::getLogger()->error(Exception::MSG_NO_FILENAME);
            throw new Exception(Exception::MSG_NO_FILENAME);
        }

        //build URI
        $strURI = $this->strURIFile . $fileName;
        if ($storageName != '') {
            $strURI .= '?storage=' . $storageName;
        }
        //sign URI
        $signedURI = Utils::sign($strURI);

        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');

        $outputPath = AsposeApp::$outPutLocation . basename($fileName);
        Utils::saveFile($responseStream, $outputPath);

        return $outputPath;
    }
608513
public function filesFrom($folder, $extension)
    {

        $all_files  = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($folder));
        $files = new \RegexIterator($all_files, '/\.'.$extension.'$/');
        $fileList = array();
        foreach ($files as $file) {
            $fileList[$file->getPathName()]['path'] = $file->getPathName();
            $fileList[$file->getPathName()]['name'] = $file->getFileName();
        }
        return $fileList;
    }
667278
public function directories($directory = null, $recursive = false)
    {

        $directories = [ ];

        foreach (Finder::create()->in($directory)->directories() as $dir) {
            $directories[] = $dir->getPathname();
        }

        return $directories;
    }
1367
public static function ExtractList($sListName){
            $oThis = self::CreateInstanceIfNotExists();
            $iStart = strpos($oThis->sBuffer, "{list:{$sListName}}");

            if($iStart > 0)
                $iEnd = strpos($oThis->sBuffer, "{end}", $iStart);

            if($iStart > 0 && $iEnd > 0){
                $sNewBuffer = substr($oThis->sBuffer, $iStart, $iEnd-$iStart);
                $oThis->sBuffer = $sNewBuffer."{end}";
            }
        }
94756
public function getFolderByName(
       $folderName,
       $includeTrash = false,
       \Google_Service_Drive_DriveFile $parent = null,
       $createIfNotFound = false
    ) {
        return $this->getFileByName($folderName, self::MIME_FOLDER, $includeTrash, $parent,
           $createIfNotFound);
    }
1070372
public static function find($filename)
    {
        // Split to folders and the actual filename, and traverse the structure.
        $parts = array_filter(preg_split("#[/\\\\]+#", $filename));
        $parentID = 0;
        /** @var File $item */
        $item = null;
        foreach ($parts as $part) {
            $item = File::get()->filter(array(
                'Name' => $part,
                'ParentID' => $parentID
            ))->first();
            if (!$item) {
                break;
            }
            $parentID = $item->ID;
        }

        return $item;
    }
668290
protected function findSelectedStorageFactoryNameInStorageConfig($storageConfig)
    {
        foreach ($storageConfig as $name => $value) {
            if (isset($this->storagesFactories[$name])) {
                return $name;
            }
        }
    }
1289788
public function fileExists($fileName, $storageName = '')
    {
        //check whether file is set or not
        if ($fileName == '') {
            AsposeApp::getLogger()->error(Exception::MSG_NO_FILENAME);
            throw new Exception(Exception::MSG_NO_FILENAME);
        }

        //build URI
        $strURI = $this->strURIExist . $fileName;
        if ($storageName != '') {
            $strURI .= '?storage=' . $storageName;
        }
        //sign URI
        $signedURI = Utils::sign($strURI);

        $responseStream = json_decode(Utils::processCommand($signedURI, 'GET', '', ''));
        if (!$responseStream->FileExist->IsExist) {
            return FALSE;
        }
        return TRUE;
    }
747650
private function fillFilePathParts(string $fileName, string $extension, string $directory): array
    {
        $fileName = $fileName ? $fileName : $this->generateFilename($this->text);

        $fullFileName = $extension
            ? "$fileName.$extension"
            : sprintf("%s.%s", $fileName, $this->format->getFileExtension());

        $directory = $directory ? $directory : $this->getTtsApiFactory()->getTargetDirectory();

        return array($fileName, $fullFileName, $directory);
    }
477268
protected function getAllMultiViewRecords($contentTypeName = null, DataDimensions $dataDimensions)
    {

        $folder = $this->getConfiguration()->getFolderNameRecords($contentTypeName, $dataDimensions);

        if (file_exists($folder))
        {
            $finder = new Finder();
            $finder->in($folder)->depth(0);

            $data = [ ];

            /** @var SplFileInfo $file */
            foreach ($finder->files()->name('*.json') as $file)
            {
                $data[] = json_decode($file->getContents(), true);

            }

            $definition = $this->getContentTypeDefinition($contentTypeName);

            $records = $this->getRecordFactory()
                            ->createRecordsFromJSONRecordsArray($definition, $data);

            return $records;

        }

        return [ ];

    }
1309987
public function getNamesWithDifferentExtension(string $fileName)
    {
        if (! file_exists($this->basePath)) {
            return [];
        }

        $extension = pathinfo($fileName, PATHINFO_EXTENSION);

        $baseName = substr($fileName, 0, strlen($fileName) - strlen($extension) - 1);

        $allNames = scandir($this->basePath);

        $namesWithDifferentExtension = array_filter($allNames, function ($existingName) use ($baseName, $extension) {
            $existingExtension = pathinfo($existingName, PATHINFO_EXTENSION);

            $existingBaseName = substr($existingName, 0, strlen($existingName) - strlen($existingExtension) - 1);

            return $existingBaseName === $baseName && $existingExtension !== $extension;
        });

        return array_values($namesWithDifferentExtension);
    }
1121880
public function getSlideCount($storageName = '', $folder = '')
    {


        //Build URI to get a list of slides
        $strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides';
        if ($folder != '') {
            $strURI .= '?folder=' . $folder;
        }

        if ($storageName != '') {
            $strURI .= '&storage=' . $storageName;
        }
        $signedURI = Utils::sign($strURI);

        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');

        $json = json_decode($responseStream);

        return count($json->Slides->SlideList);
    }
1009559
public ArrayList<String> cdn_webstorage_serviceName_storage_GET(String serviceName, OvhOrderStorageEnum storage) throws IOException {
		String qPath = "/order/cdn/webstorage/{serviceName}/storage";
		StringBuilder sb = path(qPath, serviceName);
		query(sb, "storage", storage);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, t1);
	}
61615
public function get(string $storage_name, string $key = '')
    {
        // Calls only with app name indicates, that the complete app config is requested
        if (empty($key) && !empty($this->storage[$storage_name])) {
            return $this->storage[$storage_name];
        }

        // Calls with app and key are normal cfg requests
        if (!empty($key)) {

            if (!isset($this->storage[$storage_name]->{$key})) {
                Throw new ConfigException(sprintf('Config "%s" of app "%s" does not exist.', $key, $storage_name));
            }

            return $this->storage[$storage_name]->{$key};
        }

        // All other will result in an error exception
        Throw new ConfigException(sprintf('Config "%s" of app "%s" not found.', $key, $storage_name));
    }
476593
protected function getItemFromFile(Storage $storage, SplFileInfo $file)
    {
        /* @var $item Item */
        foreach ($storage->getItems() as $item) {
            if (pathinfo($item->getPath(), PATHINFO_BASENAME) == $file->getFilename()) {
                return $item;
            }
        }

        return false;
    }
1259034
public function findFirstOccurenceOfFile(string $fileName)
    {
        if (!$this->isDir() || !$this->exists()) {
            return null;
        }

        foreach ($this->scanDir() as $file) {
            if ($file->getFileName() === $fileName) {
                return $file;
            }

            if ($file->isDir()) {
                $result = $file->findFirstOccurenceOfFile($fileName);
                if ($result !== null) {
                    return $result;
                }
            }
        }
        return null;
    }