//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using CommunityServer.Components;

namespace CommunityServer.Galleries.Components
{

    /// <summary>
    /// Utility class which can be used when running CS.Galleries
    /// in single gallery mode this class can be used to route all requests
    /// to a predefined gallery
    /// </summary>
    public class SingleGalleryLocation : Location
    {
        public SingleGalleryLocation(string path, string physicalPath, bool exclude):base(path,physicalPath,exclude)
        {
            
        }

        public override string ReWriteUrl(string path, string queryString)
        {
            string app = Globals.ApplicationPath;
            path = string.Format("{0}/{1}{2}", app, GalleryConfiguration.Instance().DefautApplicationKey, path.Substring(app.Length));
            return base.ReWriteUrl (path, queryString);
        }

    }
}
