AntPathPattern

class AntPathPattern(val text: String)

AntPattern implementation for Ant-style path patterns. Examples are provided below.

Part of this mapping code has been kindly borrowed from <a href="http://ant.apache.org">Apache Ant</a>.

The mapping matches URLs using the following rules:<br>

  • ? matches one character

    • matches zero or more characters
  • ** matches zero or more 'directories' in a path

Some examples:<br>

  • <code>com/t?st.jsp</code> - matches <code>com/test.jsp</code> but also <code>com/tast.jsp</code> or <code>com/txst.jsp</code>

  • <code>com/*sp</code> - matches all <code>.jsp</code> files in the <code>com</code> directory

  • <code>org/beangle/**/*.jsp</code> - matches all <code>.jsp</code> files underneath

  • <code>com/**/test.jsp</code> - matches all <code>test.jsp</code> files underneath the <code>com</code> path the <code>org/beangle</code> path

  • <code>org/**/servlet/bla.jsp</code> - matches <code>org/beangle/servlet/bla.jsp</code> but also <code>org/beangle/testing/servlet/bla.jsp</code> and <code>org/servlet/bla.jsp</code>

Since

3.1.0

Companion
object
class Object
trait Matchable
class Any

Value members

Concrete methods

override def equals(obj: Any): Boolean
Definition Classes
Any
override def hashCode(): Int
Definition Classes
Any
def matchStart(path: String): Boolean
def matches(path: String): Boolean
override def toString(): String
Definition Classes
Any

Concrete fields

val pattern: Pattern
val text: String