/// <summary>
		/// Determines if the condition is matched.
		/// </summary>
		/// <param name="context">The rewriting context.</param>
		/// <returns>True if the condition is met.</returns>
		public bool IsMatch(RewriteContext context)
		{
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            string filename = context.MapPath(context.Expand(_location));
			return File.Exists(filename) || Directory.Exists(filename);
		}
Esempio n. 2
0
        /// <summary>
        /// Determines if the condition is matched.
        /// </summary>
        /// <param name="context">The rewriting context.</param>
        /// <returns>True if the condition is met.</returns>
        public bool IsMatch(RewriteContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            string filename = context.MapPath(context.Expand(_location));

            return(File.Exists(filename) || Directory.Exists(filename));
        }
Esempio n. 3
0
        /// <summary>
        /// Determines if the condition is matched.
        /// </summary>
        /// <param name="context">The rewriting context.</param>
        /// <returns>True if the condition is met.</returns>
        public bool IsMatch(RewriteContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            try
            {
                string filename = context.MapPath(context.Expand(_location));
                return(File.Exists(filename) || Directory.Exists(filename));
            }
            catch
            {
                // An HTTP exception or an I/O exception indicates that the file definitely
                // does not exist.
                return(false);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Determines if the condition is matched.
        /// </summary>
        /// <param name="context">The rewriting context.</param>
        /// <returns>True if the condition is met.</returns>
        public bool IsMatch(RewriteContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            try
            {
                string filename = context.MapPath(context.Expand(_location));
                return File.Exists(filename) || Directory.Exists(filename);
            }
            catch
            {
                // An HTTP exception or an I/O exception indicates that the file definitely
                // does not exist.
                return false;
            }
        }