Author: ningjiang
Date: Sat Dec 8 02:39:48 2012
New Revision: 1418597
URL: http://svn.apache.org/viewvc?rev=1418597&view=rev
Log:
CAMEL-4963 antInclude support for case insensitive patterns with thanks to
Matthew
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/AntPathMatcherFileFilter.java
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/AntPathMatcherGenericFileFilter.java
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
camel/trunk/camel-core/src/main/java/org/apache/camel/util/AntPathMatcher.java
camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/AntPathMatcherGenericFileFilterTest.java
camel/trunk/camel-core/src/test/java/org/apache/camel/util/AntPathMatcherTest.java
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/AntPathMatcherFileFilter.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/AntPathMatcherFileFilter.java?rev=1418597&r1=1418596&r2=1418597&view=diff
==============================================================================
---
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/AntPathMatcherFileFilter.java
(original)
+++
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/AntPathMatcherFileFilter.java
Sat Dec 8 02:39:48 2012
@@ -34,6 +34,7 @@ public class AntPathMatcherFileFilter im
private AntPathMatcher matcher = new AntPathMatcher();
private String[] excludes;
private String[] includes;
+ private boolean caseSensitive = true;
public boolean accept(File pathname) {
return acceptPathName(pathname.getPath());
@@ -54,7 +55,7 @@ public class AntPathMatcherFileFilter im
// excludes take precedence
if (excludes != null) {
for (String exclude : excludes) {
- if (matcher.match(exclude, path)) {
+ if (matcher.match(exclude, path, caseSensitive)) {
// something to exclude so we cant accept it
LOG.trace("File is excluded: {}", path);
return false;
@@ -64,7 +65,7 @@ public class AntPathMatcherFileFilter im
if (includes != null) {
for (String include : includes) {
- if (matcher.match(include, path)) {
+ if (matcher.match(include, path, caseSensitive)) {
// something to include so we accept it
LOG.trace("File is included: {}", path);
return true;
@@ -81,6 +82,25 @@ public class AntPathMatcherFileFilter im
return false;
}
+ /**
+ *
+ * @return <tt>true</tt> if case sensitive pattern matching is on,
+ * <tt>false</tt> if case sensitive pattern matching is off.
+ */
+ public boolean isCaseSensitive() {
+ return caseSensitive;
+ }
+
+ /**
+ * Sets Whether or not pattern matching should be case sensitive
+ * <p/>
+ * Is by default turned on <tt>true</tt>.
+ * @param caseSensitive <tt>false</tt> to disable case sensitive pattern
matching
+ */
+ public void setCaseSensitive(boolean caseSensitive) {
+ this.caseSensitive = caseSensitive;
+ }
+
public String[] getExcludes() {
return excludes;
}
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/AntPathMatcherGenericFileFilter.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/AntPathMatcherGenericFileFilter.java?rev=1418597&r1=1418596&r2=1418597&view=diff
==============================================================================
---
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/AntPathMatcherGenericFileFilter.java
(original)
+++
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/AntPathMatcherGenericFileFilter.java
Sat Dec 8 02:39:48 2012
@@ -74,4 +74,17 @@ public class AntPathMatcherGenericFileFi
public void setIncludes(String includes) {
filter.setIncludes(includes);
}
+
+ /**
+ * Sets case sensitive flag on {@link
org.apache.camel.component.file.AntPathMatcherFileFilter}
+ * <p/>
+ * Is by default turned on <tt>true</tt>.
+ */
+ public void setCaseSensitive(boolean caseSensitive) {
+ filter.setCaseSensitive(caseSensitive);
+ }
+
+ public boolean isCaseSensitive() {
+ return filter.isCaseSensitive();
+ }
}
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java?rev=1418597&r1=1418596&r2=1418597&view=diff
==============================================================================
---
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
(original)
+++
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
Sat Dec 8 02:39:48 2012
@@ -274,6 +274,18 @@ public abstract class GenericFileEndpoin
this.antFilter.setExcludes(antExclude);
}
+ /**
+ * Sets case sensitive flag on {@link
org.apache.camel.component.file.AntPathMatcherFileFilter}
+ * <p/>
+ * Is by default turned on <tt>true</tt>.
+ */
+ public void setAntFilterCaseSensitive(boolean antFilterCaseSensitive) {
+ if (this.antFilter == null) {
+ this.antFilter = new AntPathMatcherGenericFileFilter<T>();
+ }
+ this.antFilter.setCaseSensitive(antFilterCaseSensitive);
+ }
+
public GenericFileFilter<T> getAntFilter() {
return antFilter;
}
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/util/AntPathMatcher.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/AntPathMatcher.java?rev=1418597&r1=1418596&r2=1418597&view=diff
==============================================================================
---
camel/trunk/camel-core/src/main/java/org/apache/camel/util/AntPathMatcher.java
(original)
+++
camel/trunk/camel-core/src/main/java/org/apache/camel/util/AntPathMatcher.java
Sat Dec 8 02:39:48 2012
@@ -74,11 +74,19 @@ public class AntPathMatcher {
}
public boolean match(String pattern, String path) {
- return doMatch(pattern, path, true);
+ return match(pattern, path, true);
}
public boolean matchStart(String pattern, String path) {
- return doMatch(pattern, path, false);
+ return matchStart(pattern, path, true);
+ }
+
+ public boolean match(String pattern, String path, boolean isCaseSensitive)
{
+ return doMatch(pattern, path, true, isCaseSensitive);
+ }
+
+ public boolean matchStart(String pattern, String path, boolean
isCaseSensitive) {
+ return doMatch(pattern, path, false, isCaseSensitive);
}
/**
@@ -89,10 +97,12 @@ public class AntPathMatcher {
* @param path the path String to test
* @param fullMatch whether a full pattern match is required (else a
pattern
* match as far as the given base path goes is sufficient)
+ * @param isCaseSensitive Whether or not matching should be performed
+ * case sensitively.
* @return <code>true</code> if the supplied <code>path</code> matched,
* <code>false</code> if it didn't
*/
- protected boolean doMatch(String pattern, String path, boolean fullMatch) {
+ protected boolean doMatch(String pattern, String path, boolean fullMatch,
boolean isCaseSensitive) {
if (path.startsWith(this.pathSeparator) !=
pattern.startsWith(this.pathSeparator)) {
return false;
}
@@ -111,7 +121,7 @@ public class AntPathMatcher {
if ("**".equals(patDir)) {
break;
}
- if (!matchStrings(patDir, pathDirs[pathIdxStart])) {
+ if (!matchStrings(patDir, pathDirs[pathIdxStart],
isCaseSensitive)) {
return false;
}
pattIdxStart++;
@@ -151,7 +161,7 @@ public class AntPathMatcher {
if (patDir.equals("**")) {
break;
}
- if (!matchStrings(patDir, pathDirs[pathIdxEnd])) {
+ if (!matchStrings(patDir, pathDirs[pathIdxEnd], isCaseSensitive)) {
return false;
}
pattIdxEnd--;
@@ -191,7 +201,7 @@ public class AntPathMatcher {
for (int j = 0; j < patLength; j++) {
String subPat = pattDirs[pattIdxStart + j + 1];
String subStr = pathDirs[pathIdxStart + i + j];
- if (!matchStrings(subPat, subStr)) {
+ if (!matchStrings(subPat, subStr, isCaseSensitive)) {
continue strLoop;
}
}
@@ -225,10 +235,12 @@ public class AntPathMatcher {
* @param pattern pattern to match against. Must not be <code>null</code>.
* @param str string which must be matched against the pattern. Must not be
* <code>null</code>.
+ * @param caseSensitive Whether or not matching should be performed
+ * case sensitively.
* @return <code>true</code> if the string matches against the pattern, or
* <code>false</code> otherwise.
*/
- private boolean matchStrings(String pattern, String str) {
+ private boolean matchStrings(String pattern, String str, boolean
caseSensitive) {
char[] patArr = pattern.toCharArray();
char[] strArr = str.toCharArray();
int patIdxStart = 0;
@@ -253,7 +265,7 @@ public class AntPathMatcher {
for (int i = 0; i <= patIdxEnd; i++) {
ch = patArr[i];
if (ch != '?') {
- if (ch != strArr[i]) {
+ if (different(caseSensitive, ch, strArr[i])) {
return false;
// Character mismatch
}
@@ -269,7 +281,7 @@ public class AntPathMatcher {
// Process characters before first star
while ((ch = patArr[patIdxStart]) != '*' && strIdxStart <= strIdxEnd) {
if (ch != '?') {
- if (ch != strArr[strIdxStart]) {
+ if (different(caseSensitive, ch, strArr[strIdxStart])) {
return false;
// Character mismatch
}
@@ -291,7 +303,7 @@ public class AntPathMatcher {
// Process characters after last star
while ((ch = patArr[patIdxEnd]) != '*' && strIdxStart <= strIdxEnd) {
if (ch != '?') {
- if (ch != strArr[strIdxEnd]) {
+ if (different(caseSensitive, ch, strArr[strIdxEnd])) {
return false;
// Character mismatch
}
@@ -335,7 +347,7 @@ public class AntPathMatcher {
for (int j = 0; j < patLength; j++) {
ch = patArr[patIdxStart + j + 1];
if (ch != '?') {
- if (ch != strArr[strIdxStart + i + j]) {
+ if (different(caseSensitive, ch, strArr[strIdxStart +
i + j])) {
continue strLoop;
}
}
@@ -453,4 +465,7 @@ public class AntPathMatcher {
return tokens.toArray(new String[tokens.size()]);
}
+ private static boolean different(boolean caseSensitive, char ch, char
other) {
+ return caseSensitive ? ch != other : Character.toUpperCase(ch) !=
Character.toUpperCase(other);
+ }
}
Modified:
camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/AntPathMatcherGenericFileFilterTest.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/AntPathMatcherGenericFileFilterTest.java?rev=1418597&r1=1418596&r2=1418597&view=diff
==============================================================================
---
camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/AntPathMatcherGenericFileFilterTest.java
(original)
+++
camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/AntPathMatcherGenericFileFilterTest.java
Sat Dec 8 02:39:48 2012
@@ -37,26 +37,35 @@ public class AntPathMatcherGenericFileFi
@Override
protected JndiRegistry createRegistry() throws Exception {
+ AntPathMatcherGenericFileFilter<File> filterNotCaseSensitive = new
AntPathMatcherGenericFileFilter<File>("**/c*");
+ filterNotCaseSensitive.setCaseSensitive(false);
+
JndiRegistry jndi = super.createRegistry();
jndi.bind("filter", new
AntPathMatcherGenericFileFilter<File>("**/c*"));
+ jndi.bind("caseInsensitiveFilter", filterNotCaseSensitive);
return jndi;
}
public void testInclude() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result1");
mock.expectedBodiesReceivedInAnyOrder("Hello World");
+ mock.setExpectedMessageCount(1);
template.sendBodyAndHeader("file://target/files/ant-path-1/x/y/z",
"Hello World", Exchange.FILE_NAME, "report.txt");
+ template.sendBodyAndHeader("file://target/files/ant-path-1/x/y/z",
"Hello World 2", Exchange.FILE_NAME, "b.TXT");
assertMockEndpointsSatisfied();
}
public void testExclude() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result2");
- mock.expectedBodiesReceivedInAnyOrder("Hello World 2");
+ mock.expectedBodiesReceivedInAnyOrder("Hello World 2", "Hello World
3", "Hello World 4");
+ mock.setExpectedMessageCount(3);
template.sendBodyAndHeader("file://target/files/ant-path-2/x/y/z",
"Hello World 1", Exchange.FILE_NAME, "report.bak");
template.sendBodyAndHeader("file://target/files/ant-path-2/x/y/z",
"Hello World 2", Exchange.FILE_NAME, "report.txt");
+ template.sendBodyAndHeader("file://target/files/ant-path-2/x/y/z",
"Hello World 3", Exchange.FILE_NAME, "b.BAK");
+ template.sendBodyAndHeader("file://target/files/ant-path-2/x/y/z",
"Hello World 4", Exchange.FILE_NAME, "b.TXT");
assertMockEndpointsSatisfied();
}
@@ -64,6 +73,7 @@ public class AntPathMatcherGenericFileFi
public void testIncludesAndExcludes() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result3");
mock.expectedBodiesReceivedInAnyOrder("Hello World 2", "Hello World
4");
+ mock.setExpectedMessageCount(2);
template.sendBodyAndHeader("file://target/files/ant-path-3/x/y/z",
"Hello World 1", Exchange.FILE_NAME, "a.pdf");
template.sendBodyAndHeader("file://target/files/ant-path-3/x/y/z",
"Hello World 2", Exchange.FILE_NAME, "m.pdf");
@@ -71,6 +81,12 @@ public class AntPathMatcherGenericFileFi
template.sendBodyAndHeader("file://target/files/ant-path-3/x/y/z",
"Hello World 4", Exchange.FILE_NAME, "m.txt");
template.sendBodyAndHeader("file://target/files/ant-path-3/x/y/z",
"Hello World 5", Exchange.FILE_NAME, "b.bak");
template.sendBodyAndHeader("file://target/files/ant-path-3/x/y/z",
"Hello World 6", Exchange.FILE_NAME, "m.bak");
+ template.sendBodyAndHeader("file://target/files/ant-path-3/x/y/z",
"Hello World 7", Exchange.FILE_NAME, "ay.PDF");
+ template.sendBodyAndHeader("file://target/files/ant-path-3/x/y/z",
"Hello World 8", Exchange.FILE_NAME, "my.Pdf");
+ template.sendBodyAndHeader("file://target/files/ant-path-3/x/y/z",
"Hello World 9", Exchange.FILE_NAME, "by.TXT");
+ template.sendBodyAndHeader("file://target/files/ant-path-3/x/y/z",
"Hello World 10", Exchange.FILE_NAME, "my.TxT");
+ template.sendBodyAndHeader("file://target/files/ant-path-3/x/y/z",
"Hello World 11", Exchange.FILE_NAME, "by.BAK");
+ template.sendBodyAndHeader("file://target/files/ant-path-3/x/y/z",
"Hello World 12", Exchange.FILE_NAME, "my.BaK");
assertMockEndpointsSatisfied();
}
@@ -78,10 +94,70 @@ public class AntPathMatcherGenericFileFi
public void testIncludesAndExcludesAndFilter() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result4");
mock.expectedBodiesReceivedInAnyOrder("Hello World 3");
+ mock.setExpectedMessageCount(1);
template.sendBodyAndHeader("file://target/files/ant-path-4/x/y/z",
"Hello World 1", Exchange.FILE_NAME, "a.txt");
template.sendBodyAndHeader("file://target/files/ant-path-4/x/y/z",
"Hello World 2", Exchange.FILE_NAME, "b.txt");
template.sendBodyAndHeader("file://target/files/ant-path-4/x/y/z",
"Hello World 3", Exchange.FILE_NAME, "c.txt");
+ template.sendBodyAndHeader("file://target/files/ant-path-4/x/y/z",
"Hello World 4", Exchange.FILE_NAME, "Cy.txt");
+
+ assertMockEndpointsSatisfied();
+ }
+
+
+ public void testIncludeAndAntFilterNotCaseSensitive() throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:result5");
+ mock.expectedBodiesReceivedInAnyOrder("Hello World");
+ mock.setExpectedMessageCount(1);
+
+ template.sendBodyAndHeader("file://target/files/ant-path-5/x/y/z",
"Hello World", Exchange.FILE_NAME, "report.TXT");
+
+ assertMockEndpointsSatisfied();
+ }
+
+ public void testExcludeAndAntFilterNotCaseSensitive() throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:result6");
+ mock.expectedBodiesReceivedInAnyOrder("Hello World 2", "Hello World
4");
+ mock.setExpectedMessageCount(2);
+
+ template.sendBodyAndHeader("file://target/files/ant-path-6/x/y/z",
"Hello World 1", Exchange.FILE_NAME, "report.bak");
+ template.sendBodyAndHeader("file://target/files/ant-path-6/x/y/z",
"Hello World 2", Exchange.FILE_NAME, "report.txt");
+ template.sendBodyAndHeader("file://target/files/ant-path-6/x/y/z",
"Hello World 3", Exchange.FILE_NAME, "b.BAK");
+ template.sendBodyAndHeader("file://target/files/ant-path-6/x/y/z",
"Hello World 4", Exchange.FILE_NAME, "b.TXT");
+
+ assertMockEndpointsSatisfied();
+ }
+
+ public void testIncludesAndExcludesAndAntFilterNotCaseSensitive() throws
Exception {
+ MockEndpoint mock = getMockEndpoint("mock:result7");
+ mock.expectedBodiesReceivedInAnyOrder("Hello World 2", "Hello World
4", "Hello World 8", "Hello World 10");
+ mock.setExpectedMessageCount(4);
+
+ template.sendBodyAndHeader("file://target/files/ant-path-7/x/y/z",
"Hello World 1", Exchange.FILE_NAME, "a.pdf");
+ template.sendBodyAndHeader("file://target/files/ant-path-7/x/y/z",
"Hello World 2", Exchange.FILE_NAME, "m.pdf");
+ template.sendBodyAndHeader("file://target/files/ant-path-7/x/y/z",
"Hello World 3", Exchange.FILE_NAME, "b.txt");
+ template.sendBodyAndHeader("file://target/files/ant-path-7/x/y/z",
"Hello World 4", Exchange.FILE_NAME, "m.txt");
+ template.sendBodyAndHeader("file://target/files/ant-path-7/x/y/z",
"Hello World 5", Exchange.FILE_NAME, "b.bak");
+ template.sendBodyAndHeader("file://target/files/ant-path-7/x/y/z",
"Hello World 6", Exchange.FILE_NAME, "m.bak");
+ template.sendBodyAndHeader("file://target/files/ant-path-7/x/y/z",
"Hello World 7", Exchange.FILE_NAME, "ay.PDF");
+ template.sendBodyAndHeader("file://target/files/ant-path-7/x/y/z",
"Hello World 8", Exchange.FILE_NAME, "my.Pdf");
+ template.sendBodyAndHeader("file://target/files/ant-path-7/x/y/z",
"Hello World 9", Exchange.FILE_NAME, "by.TXT");
+ template.sendBodyAndHeader("file://target/files/ant-path-7/x/y/z",
"Hello World 10", Exchange.FILE_NAME, "my.TxT");
+ template.sendBodyAndHeader("file://target/files/ant-path-7/x/y/z",
"Hello World 11", Exchange.FILE_NAME, "By.BAK");
+ template.sendBodyAndHeader("file://target/files/ant-path-7/x/y/z",
"Hello World 12", Exchange.FILE_NAME, "My.BaK");
+
+ assertMockEndpointsSatisfied();
+ }
+
+ public void testIncludesAndExcludesAndFilterAndAntFilterNotCaseSensitive()
throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:result8");
+ mock.expectedBodiesReceivedInAnyOrder("Hello World 3", "Hello World
4");
+ mock.setExpectedMessageCount(2);
+
+ template.sendBodyAndHeader("file://target/files/ant-path-8/x/y/z",
"Hello World 1", Exchange.FILE_NAME, "a.txt");
+ template.sendBodyAndHeader("file://target/files/ant-path-8/x/y/z",
"Hello World 2", Exchange.FILE_NAME, "b.txt");
+ template.sendBodyAndHeader("file://target/files/ant-path-8/x/y/z",
"Hello World 3", Exchange.FILE_NAME, "c.txt");
+ template.sendBodyAndHeader("file://target/files/ant-path-8/x/y/z",
"Hello World 4", Exchange.FILE_NAME, "Cy.txt");
assertMockEndpointsSatisfied();
}
@@ -90,13 +166,21 @@ public class AntPathMatcherGenericFileFi
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() throws Exception {
-
from("file://target/files/ant-path-1?recursive=true&antInclude=**/*.txt").convertBodyTo(String.class).to("mock:result1");
+
from("file://target/files/ant-path-1?recursive=true&antInclude=**/*.txt&antFilterCaseSensitive=true").convertBodyTo(String.class).to("mock:result1");
+
from("file://target/files/ant-path-5?recursive=true&antInclude=**/*.txt&antFilterCaseSensitive=false").convertBodyTo(String.class).to("mock:result5");
from("file://target/files/ant-path-2?recursive=true&antExclude=**/*.bak").convertBodyTo(String.class).to("mock:result2");
+
from("file://target/files/ant-path-6?recursive=true&antExclude=**/*.bak&antFilterCaseSensitive=false").convertBodyTo(String.class).to("mock:result6");
from("file://target/files/ant-path-3?recursive=true&antInclude=**/*.pdf,**/*.txt&antExclude=**/a*,**/b*").convertBodyTo(String.class).to("mock:result3");
+
from("file://target/files/ant-path-7?recursive=true&antInclude=**/*.Pdf,**/*.txt&antExclude=**/a*,**/b*&antFilterCaseSensitive=false").convertBodyTo(String.class).to("mock:result7");
from("file://target/files/ant-path-4?recursive=true&antInclude=**/*.txt&antExclude=**/a*&filter=#filter").convertBodyTo(String.class).to("mock:result4");
+
from("file://target/files/ant-path-8?recursive=true&antInclude=**/*.txt&antExclude=**/a*&filter=#caseInsensitiveFilter").convertBodyTo(String.class).to("mock:result8");
+
+
+
+
}
};
}
Modified:
camel/trunk/camel-core/src/test/java/org/apache/camel/util/AntPathMatcherTest.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/util/AntPathMatcherTest.java?rev=1418597&r1=1418596&r2=1418597&view=diff
==============================================================================
---
camel/trunk/camel-core/src/test/java/org/apache/camel/util/AntPathMatcherTest.java
(original)
+++
camel/trunk/camel-core/src/test/java/org/apache/camel/util/AntPathMatcherTest.java
Sat Dec 8 02:39:48 2012
@@ -39,4 +39,17 @@ public class AntPathMatcherTest extends
assertFalse(matcher.match("foo/**/*.txt", "blah/blah.txt"));
}
+ public void testCaseSensitive() {
+ AntPathMatcher matcher = new AntPathMatcher();
+ assertTrue(matcher.match("foo/**/*.txt", "foo/blah.txt", true));
+ assertTrue(matcher.match("foo/**/*.txt", "foo/blah.txt", false));
+ assertTrue(matcher.match("foo/**/*.txt", "foo/BLAH.txt"));
+ assertFalse(matcher.match("FOO/**/*.txt", "foo/blah.txt"));
+ assertFalse(matcher.match("foo/**/*.TXT", "foo/blah.txt"));
+ assertTrue(matcher.match("foo/**/*.TXT", "foo/blah.txt", false));
+ assertTrue(matcher.match("FOO/**/*.txt", "foo/blah.txt", false));
+ assertFalse(matcher.match("FOO/**/*.txt", "foo/blah.txt", true));
+ assertFalse(matcher.match("FOO/**/*.txt", "foo/blah.txt", true));
+ }
+
}
Modified:
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java?rev=1418597&r1=1418596&r2=1418597&view=diff
==============================================================================
---
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
(original)
+++
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
Sat Dec 8 02:39:48 2012
@@ -156,6 +156,7 @@ public class CxfEndpoint extends Default
private BindingConfiguration bindingConfig;
private DataBinding dataBinding;
private ReflectionServiceFactoryBean serviceFactoryBean;
+ private CxfEndpointConfigurer configurer;
public CxfEndpoint(String remaining, CxfComponent cxfComponent) {
@@ -323,6 +324,9 @@ public class CxfEndpoint extends Default
sfb.setBus(getBus());
sfb.setStart(false);
+ if (getCxfEndpointConfigurer() != null) {
+ getCxfEndpointConfigurer().configure(sfb);
+ }
}
/**
@@ -494,6 +498,9 @@ public class CxfEndpoint extends Default
}
factoryBean.setBus(getBus());
+ if (getCxfEndpointConfigurer() != null) {
+ getCxfEndpointConfigurer().configure(factoryBean);
+ }
}
// Package private methods
@@ -1076,5 +1083,13 @@ public class CxfEndpoint extends Default
this.serviceFactoryBean = serviceFactoryBean;
}
+ public CxfEndpointConfigurer getCxfEndpointConfigurer() {
+ return configurer;
+ }
+
+ public void setCxfEndpointConfigurer(CxfEndpointConfigurer configurer) {
+ this.configurer = configurer;
+ }
+
}