add public API to PathMatcher
This commit is contained in:
parent
87aa1c7ca1
commit
286ab07793
4 changed files with 18 additions and 18 deletions
|
@ -1,6 +1,6 @@
|
||||||
group = org.xbib
|
group = org.xbib
|
||||||
name = net
|
name = net
|
||||||
version = 1.0.0
|
version = 1.0.1
|
||||||
|
|
||||||
junit.version = 4.12
|
junit.version = 4.12
|
||||||
asciidoclet.version = 1.5.4
|
asciidoclet.version = 1.5.4
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
ext {
|
ext {
|
||||||
user = 'xbib'
|
user = 'xbib'
|
||||||
projectName = 'content'
|
projectName = 'net'
|
||||||
projectDescription = 'Content processing library for Java'
|
projectDescription = 'Network classes for Java'
|
||||||
scmUrl = 'https://github.com/xbib/content'
|
scmUrl = 'https://github.com/xbib/net'
|
||||||
scmConnection = 'scm:git:git://github.com/xbib/content.git'
|
scmConnection = 'scm:git:git://github.com/xbib/net.git'
|
||||||
scmDeveloperConnection = 'scm:git:git://github.com/xbib/content.git'
|
scmDeveloperConnection = 'scm:git:git://github.com/xbib/net.git'
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
|
|
||||||
task xbibUpload(type: Upload, dependsOn: build) {
|
task xbibUpload(type: Upload) {
|
||||||
configuration = configurations.archives
|
configuration = configurations.archives
|
||||||
uploadDescriptor = true
|
uploadDescriptor = true
|
||||||
repositories {
|
repositories {
|
||||||
if (project.hasProperty('xbibUsername')) {
|
if (project.hasProperty("xbibUsername")) {
|
||||||
mavenDeployer {
|
mavenDeployer {
|
||||||
configuration = configurations.wagon
|
configuration = configurations.wagon
|
||||||
repository(url: uri('scpexe://xbib.org/repository')) {
|
repository(url: 'sftp://xbib.org/repository') {
|
||||||
authentication(userName: xbibUsername, privateKey: xbibPrivateKey)
|
authentication(userName: xbibUsername, privateKey: xbibPrivateKey)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ task sonatypeUpload(type: Upload, dependsOn: build) {
|
||||||
name project.name
|
name project.name
|
||||||
description projectDescription
|
description projectDescription
|
||||||
packaging 'jar'
|
packaging 'jar'
|
||||||
inceptionYear '2016'
|
inceptionYear '2017'
|
||||||
url scmUrl
|
url scmUrl
|
||||||
organization {
|
organization {
|
||||||
name 'xbib'
|
name 'xbib'
|
||||||
|
@ -45,7 +45,7 @@ task sonatypeUpload(type: Upload, dependsOn: build) {
|
||||||
id user
|
id user
|
||||||
name 'Jörg Prante'
|
name 'Jörg Prante'
|
||||||
email 'joergprante@gmail.com'
|
email 'joergprante@gmail.com'
|
||||||
url 'https://github.com/jprante'
|
url 'https://github.com/xbib'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
scm {
|
scm {
|
||||||
|
|
|
@ -60,23 +60,23 @@ public class PathMatcher {
|
||||||
return queryParameters;
|
return queryParameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setCachePatterns(boolean cachePatterns) {
|
public void setCachePatterns(boolean cachePatterns) {
|
||||||
this.cachePatterns = cachePatterns;
|
this.cachePatterns = cachePatterns;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, PathStringMatcher> stringMatcherCache() {
|
public Map<String, PathStringMatcher> stringMatcherCache() {
|
||||||
return stringMatcherCache;
|
return stringMatcherCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean match(String pattern, String path) {
|
public boolean match(String pattern, String path) {
|
||||||
return doMatch(pattern, path, true, null);
|
return doMatch(pattern, path, true, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean matchStart(String pattern, String path) {
|
public boolean matchStart(String pattern, String path) {
|
||||||
return doMatch(pattern, path, false, null);
|
return doMatch(pattern, path, false, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
String extractPathWithinPattern(String pattern, String path) {
|
public String extractPathWithinPattern(String pattern, String path) {
|
||||||
List<String> patternParts = tokenize(pattern, this.pathSeparator, this.trimTokens, true);
|
List<String> patternParts = tokenize(pattern, this.pathSeparator, this.trimTokens, true);
|
||||||
List<String> pathParts = tokenize(path, this.pathSeparator, this.trimTokens, true);
|
List<String> pathParts = tokenize(path, this.pathSeparator, this.trimTokens, true);
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
@ -97,7 +97,7 @@ public class PathMatcher {
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
String combine(String pattern1, String pattern2) {
|
public String combine(String pattern1, String pattern2) {
|
||||||
if (!hasText(pattern1) && !hasText(pattern2)) {
|
if (!hasText(pattern1) && !hasText(pattern2)) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue