Return preview directory for the DMS document preview images.

@param	bool	$blnAppendTrailingSlash	True if a trailing slash should be appended.
@return	string	The path to the preview directory.
437536
public static function getPreviewDirectory($blnAppendTrailingSlash)
	{
		$path = self::getBaseDirectory(true) . self::DIRECTORY_NAME_PREVIEW;
		
		if ($blnAppendTrailingSlash)
		{
			$path .= "/";
		}
		return $path;
	}
540017
public static function getApplicationPath(string $append = null): string
    {
        if ($append === null) {
            return static::$applicationPath;
        } else {
            return str_replace(DS . DS, DS, static::$applicationPath . $append);
        }
    }
889046
public static function addTrailingSlash( $path, $slash = DIRECTORY_SEPARATOR ) {
		$path = static::normalizePath( $path, $slash );
		$path = preg_replace( '~' . preg_quote( $slash, '~' ) . '*$~', $slash, $path );
		return $path;
	}
40587
public static function getAbsUrl($urlFrom, $urlTo)
    {
        if (strpos($urlTo, '://') !== false) {
            // already absolute;
            return $urlTo;
        }
        $urlAbs = $urlTo;
        if (is_array($urlFrom)) {
            $urlParts = $urlFrom;
        } else {
            $urlParts = Html::parseUrl($urlFrom);
        }
        $urlParts['query']      = null; // do not want absolute url's query
        $urlParts['params']     = array();
        $urlParts['fragment']   = null; // do not want absolute url's fragment
        $path = '';
        if ($urlTo{0} != '/') {
            preg_match('/^(\/.*\/)/', $urlParts['path'], $matches);
            $path = isset($matches[1])
                ? $matches[1]
                : '/';
        }
        $path .= $urlTo;
        $pathSegs = explode('/', $path);
        $pathStack = array();
        foreach ($pathSegs as $k => $seg) {
            if ($seg === '' && $k != 0 && $k < count($pathSegs)-1) {
                continue;
            } elseif ($seg === '.') {
                continue;
            } elseif ($seg === '..') {
                if (array_pop($pathStack) === '') {
                    $pathStack[] = '';
                }
            } else {
                $pathStack[] = $seg;
            }
        }
        $urlParts['path'] = implode('/', $pathStack);
        $urlAbs = Html::buildUrl($urlParts);
        return $urlAbs;
    }
1153278
public function getImageUrl($sFile = null, $bSsl = null)
    {
        if ($sFile) {
            $sValue = $this->getConfig()->getImageUrl($this->isAdmin(), $bSsl, null, $sFile);
        } elseif (($sValue = $this->getViewConfigParam('imagedir')) === null) {
            $sValue = $this->getConfig()->getImageUrl($this->isAdmin(), $bSsl);
            $this->setViewConfigParam('imagedir', $sValue);
        }

        return $sValue;
    }
694226
def preview(src_path):
  ''' 
  '''
  preview = embedded_preview(src_path)

  if not is_valid_preview(preview):
    preview = generator_preview(src_path)

  if not is_valid_preview(preview):
    preview = thumbnail_preview(src_path)

  # Ensure the preview is returned in the right format
  if is_valid_preview(preview):
    if mimetype(preview) in [ExportMimeType.PNG]:
      return [preview]

    if mimetype(preview) in [ExportMimeType.PDF]:
      return to_pngs(preview)

  return []
1365741
protected function & urlCorrectTrailingSlashBehaviour (& $urlPath) {
		$trailingSlashBehaviour = $this->_trailingSlashBehaviour ?: (
			$this->_trailingSlashBehaviour = $this->router->GetTrailingSlashBehaviour()
		);
		$urlPathLength = mb_strlen($urlPath);
		$lastCharIsSlash = $urlPathLength > 0 && mb_substr($urlPath, $urlPathLength - 1) === '/';
		if (!$lastCharIsSlash && $trailingSlashBehaviour === \MvcCore\IRouter::TRAILING_SLASH_ALWAYS) {
			$urlPath .= '/';
		} else if ($lastCharIsSlash && $trailingSlashBehaviour === \MvcCore\IRouter::TRAILING_SLASH_REMOVE) {
			$urlPath = mb_substr($urlPath, 0, $urlPathLength - 1);
		}
		if ($urlPath === '') 
			$urlPath = '/';
		return $urlPath;
	}
1064566
protected function getDestinationPath($viewsDirectory)
    {
        $path = Config::getViewsPath();

        if (!empty($viewsDirectory)) {
            $path .= Helpers::getPathWithSlash($viewsDirectory);
        }

        return $path;
    }
1196619
public function getBaseDirectory($directoryToAppend = null)
    {

        // load the base directory from the system configuration
        $baseDirectory = $this->getSystemConfiguration()->getBaseDirectory();

        // if a directory has been passed, make it absolute and append it
        if ($directoryToAppend != null) {
            $baseDirectory .= $this->makePathAbsolute($directoryToAppend);
        }

        // return the base directory, with the passed path appended
        return $baseDirectory;
    }
172574
public static String getCurrentAbsolutPathWithoutDotAndSlash()
	{
		final File currentAbsolutPath = new File(".");
		return currentAbsolutPath.getAbsolutePath().substring(0,
			currentAbsolutPath.getAbsolutePath().length() - 2);
	}
507557
protected function _getCustomTemplateFilename() {
        $filePath = $this->_formatTemplate(
            Mage::getStoreConfig('turpentine_varnish/servers/custom_vcl_template'),
            array('root_dir' => Mage::getBaseDir())
        );
        if (is_file($filePath)) { return $filePath; } else { return null; }
    }
874985
public static function getTempDirectory($blnAppendTrailingSlash)
	{
		$path = self::getBaseDirectory(true) . self::DIRECTORY_NAME_TEMP;
		
		if ($blnAppendTrailingSlash)
		{
			$path .= "/";
		}
		return $path;
	}
214657
public function getDumpFilePath () : string
    {
        $dir = dirname($this->filePath);
        $fileName = \basename($this->filePath, ".{$this->fileType}");

        $dir = "." === $dir
            ? ""
            : "{$dir}/";

        $hash = !empty($this->fileNameHash)
            ? ".{$this->fileNameHash}"
            : "";

        return "{$dir}{$fileName}{$hash}.{$this->fileType}";
    }
1162398
private function prepareGetStorageDescriptorPath()
    {
        $fragment = new CNabuPHPMethodBuilder(
                $this,
                'getStorageDescriptorPath',
                CNabuPHPMethodBuilder::METHOD_PUBLIC,
                true
        );
        $fragment->addComment('Get the file name and path where is stored the descriptor in JSON format.');
        $fragment->addComment('@return string Return the file name with the full path');
        $fragment->addFragment("return preg_replace('/.php$/', '.json', __FILE__);");

        $this->addFragment($fragment);
    }
357506
public function build($trailingSlash = false)
	{
		$result = '';
		
		foreach(preg_split("'(\\{(?:(?>[^\\{\\}]+)|(?R))+\\})'S", $this->uri, -1, PREG_SPLIT_DELIM_CAPTURE) as $part)
		{
			if(substr($part, 0, 1) == '{')
			{
				$result .= Uri::encode($this->path[substr($part, 1, -1)]);
			}
			else
			{
				$result .= $part;
			}
		}
		
		$result = $this->replaceParams($this->uri, $this->path);
		
		if($trailingSlash && substr($result, -1) != '/')
		{
			$uri = new Uri($result . '/');
		}
		else
		{
			$uri = new Uri($result);
		}
		
		if(!empty($this->query))
		{
			$uri = $uri->setQuery($this->query);
		}
		
		if($this->fragment !== NULL)
		{
			if(false === strpos($this->fragment, '{'))
			{
				$uri = $uri->setFragment($this->fragment);
			}
			else
			{
				$uri = $uri->setFragment($this->replaceParams($this->fragment, $this->path));
			}
		}
		
		return $uri;
	}
297891
public String getDebugMessageAsHTML()
    {
        Throwable rootEx = getRootCause();
        if (isApplicationError(rootEx, "com.ibm.ws.webcontainer"))
        {
            String trimmedStackHtml = ApplicationErrorUtils.getTrimmedStackHtml(rootEx);
            return trimmedStackHtml;
        }
        else
            return "Error " + getErrorCode() + ": " + getMessage();   
    }
333774
private function findPhpDocumentorPath()
    {
        $phpDocumentorPath = null;
        $directories = ['phpDocumentor', 'phpdocumentor'];
        foreach ($directories as $directory) {
            foreach (Phing::explodeIncludePath() as $path) {
                $testPhpDocumentorPath = $path . DIRECTORY_SEPARATOR . $directory . DIRECTORY_SEPARATOR . 'src';
                if (file_exists($testPhpDocumentorPath)) {
                    $phpDocumentorPath = $testPhpDocumentorPath;
                }
            }
        }

        return $phpDocumentorPath;
    }