Exemplo n.º 1
0
 /// <summary>
 /// Executes the action.
 /// </summary>
 /// <param name="context">The rewrite context.</param>
 public RewriteProcessing Execute(RewriteContext context)
 {
     if (context == null)
     {
         throw new ArgumentNullException("context");
     }
     context.Properties.Set(Name, context.Expand(Value));
     return(RewriteProcessing.ContinueProcessing);
 }
 /// <summary>
 ///     Executes the action.
 /// </summary>
 /// <param name="context">The rewriting context.</param>
 public virtual RewriteProcessing Execute(RewriteContext context)
 {
     if (context == null)
     {
         throw new ArgumentNullException("context");
     }
     context.Location = context.ResolveLocation(context.Expand(Location));
     return RewriteProcessing.StopProcessing;
 }
		/// <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);
		}
Exemplo n.º 4
0
 /// <summary>
 /// Executes the action.
 /// </summary>
 /// <param name="context">The rewrite context.</param>
 public RewriteProcessing Execute(RewriteContext context)
 {
     if (context == null)
     {
         throw new ArgumentNullException("context");
     }
     context.Properties.Set(Name, context.Expand(Value));
     return RewriteProcessing.ContinueProcessing;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Executes the action.
 /// </summary>
 /// <param name="context">The rewriting context.</param>
 public virtual RewriteProcessing Execute(RewriteContext context)
 {
     if (context == null)
     {
         throw new ArgumentNullException("context");
     }
     context.Location = context.ResolveLocation(context.Expand(Location));
     return(RewriteProcessing.StopProcessing);
 }
Exemplo n.º 6
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));
        }
Exemplo n.º 7
0
        /// <summary>
        /// Executes the action.
        /// </summary>
        /// <param name="context">The rewriting context.</param>
        public virtual RewriteProcessing Execute(RewriteContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            //TODO: MAKE THIS MORE GENERIC
            if (!context.Location.ToUpperInvariant().Contains("/LOGIN/"))
            {
                context.Location = context.ResolveLocation(context.Expand(Location));
            }

            return(RewriteProcessing.StopProcessing);
        }
Exemplo n.º 8
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);
            }
        }
Exemplo n.º 9
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;
            }
        }