static function AddExtension($path, $extension, $replaceExisting = false)
    {
        $result = $path;
        if ($replaceExisting)
        {
            $result = self::RemoveExtension($path);
        }
        if (!$extension) {
            return $result;
        }
        return join('.', array($result, System\Str::TrimLeft($extension, '.')));
    }