public static function getFileList($strDir, $baseUrl, $protectedBaseUrl = null)
    {
        $arrResult = [];
        if (is_dir($strDir))
        {
            if ($handler = opendir($strDir))
            {
                while (($strFile = readdir($handler)) !== false)
                {
                    if (substr($strFile, 0, 1) == '.')
                    {
                        continue;
                    }
                    $arrFile             = [];
                    $arrFile['filename'] = htmlentities($strFile);
                    if ($protectedBaseUrl)
                    {
                        $arrFile['absUrl'] = $protectedBaseUrl . (empty($_GET) ? '?' : '&') . 'file=' . urlencode($arrFile['absUrl']);
                    }
                    else
                    {
                        $arrFile['absUrl'] = str_replace('\\', '/', str_replace('//', '', $baseUrl . '/' . $strFile));
                    }
                    $arrFile['path']     = str_replace($arrFile['filename'], '', $arrFile['absUrl']);
                    $arrFile['filesize'] =
                        self::formatSizeUnits(filesize(str_replace('\\', '/', str_replace('//', '', $strDir . '/' . $strFile))), true);

                    $arrResult[] = $arrFile;
                }
                closedir($handler);
            }
        }
        Arrays::aasort($arrResult, 'filename');

        return $arrResult;
    }