web-path-matcher

Simple web path expression matcher

License

License

Categories

Categories

Ant Build Tools
GroupId

GroupId

com.github.antonsjava
ArtifactId

ArtifactId

web-path-matcher
Last Version

Last Version

1.1
Release Date

Release Date

Type

Type

jar
Description

Description

web-path-matcher
Simple web path expression matcher
Project URL

Project URL

https://github.com/antonsjava/web-path-matcher
Source Code Management

Source Code Management

https://github.com/antonsjava/web-path-matcher

Download web-path-matcher

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.antonsjava/web-path-matcher/ -->
<dependency>
    <groupId>com.github.antonsjava</groupId>
    <artifactId>web-path-matcher</artifactId>
    <version>1.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.antonsjava/web-path-matcher/
implementation 'com.github.antonsjava:web-path-matcher:1.1'
// https://jarcasting.com/artifacts/com.github.antonsjava/web-path-matcher/
implementation ("com.github.antonsjava:web-path-matcher:1.1")
'com.github.antonsjava:web-path-matcher:jar:1.1'
<dependency org="com.github.antonsjava" name="web-path-matcher" rev="1.1">
  <artifact name="web-path-matcher" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.antonsjava', module='web-path-matcher', version='1.1')
)
libraryDependencies += "com.github.antonsjava" % "web-path-matcher" % "1.1"
[com.github.antonsjava/web-path-matcher "1.1"]

Dependencies

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

web-path-matcher

Simple web path matching utility. Pattern to be matched can use

  • individual '?' character to represent any character
  • individual '*' character to represent any sequence of characters except '/'
  • path segment with only '*' characters (more than one) to represent any sequence of path elements

Examples

  • '/foo/**' represents paths like /foo or /foo/bar/one
  • '/foo/*.xml' represents paths like /foo/a.xml or /foo/bar.xml
  • '/foo/?.xml' represents paths like /foo/a.xml or /foo/b.xml

It is helper implementation for implementing http servlet filters and similar implementations.

Java usage

  PathMatcher matcher = PathMatcher.instance("/foo/**");
  String path = "/foo/bar";
  if(matcher.match(path)) { ... }

Maven usage

   <dependency>
      <groupId>com.github.antonsjava</groupId>
      <artifactId>web-path-matcher</artifactId>
      <version>1.0</version>
   </dependency>

Versions

Version
1.1
1.0