update from master

This commit is contained in:
yakolee
2014-07-01 17:49:58 +08:00
6 changed files with 2492 additions and 2489 deletions
+27
View File
@@ -310,6 +310,33 @@
</dependency>
</dependencies>
</profile>
<profile>
<id>mac-profile-oracle-jdk</id>
<activation>
<activeByDefault>false</activeByDefault>
<file>
<exists>${java.home}/../lib/jconsole.jar</exists>
</file>
</activation>
<dependencies>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>jconsole</artifactId>
<version>1.8.0</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/jconsole.jar</systemPath>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>tools</artifactId>
<version>1.8.0</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
</profile>
</profiles>
<dependencies>
File diff suppressed because it is too large Load Diff
@@ -59,4 +59,10 @@ public interface JdbcConstants {
* 阿里云odps
*/
public static final String ODPS = "odps";
/**
* Log4JDBC
*/
public static final String LOG4JDBC = "log4jdbc";
public static final String LOG4JDBC_DRIVER = "net.sf.log4jdbc.DriverSpy";
}
@@ -351,6 +351,8 @@ public final class JdbcUtils implements JdbcConstants {
return "org.apache.derby.jdbc.EmbeddedDriver";
} else if (rawUrl.startsWith("jdbc:mysql:")) {
return MYSQL_DRIVER;
} else if (rawUrl.startsWith("jdbc:log4jdbc:")) {
return LOG4JDBC_DRIVER;
} else if (rawUrl.startsWith("jdbc:mariadb:")) {
return MARIADB_DRIVER;
} else if (rawUrl.startsWith("jdbc:oracle:") //
@@ -421,6 +423,8 @@ public final class JdbcUtils implements JdbcConstants {
return DERBY;
} else if (rawUrl.startsWith("jdbc:mysql:")) {
return MYSQL;
} else if (rawUrl.startsWith("jdbc:log4jdbc:")) {
return LOG4JDBC;
} else if (rawUrl.startsWith("jdbc:mariadb:")) {
return MARIADB;
} else if (rawUrl.startsWith("jdbc:oracle:")) {
@@ -17,45 +17,56 @@ package com.alibaba.druid.util;
public class ServletPathMatcher implements PatternMatcher {
private final static ServletPathMatcher instance = new ServletPathMatcher();
public static ServletPathMatcher getInstance() {
return instance;
}
/**
* <p>
* three type: endsWithMatch(eg. /xxx*=/xxx/xyz), startsWithMatch(eg. *.xxx=abc.xxx), equals(eg. /xxx=/xxx).
* </p>
* <b>Notice</b>: *xxx* will match *xxxyyyy. endsWithMatch first.
*/
@Override
public boolean matches(String pattern, String source) {
if (pattern == null || source == null) {
return false;
}
pattern = pattern.trim();
source = source.trim();
if (pattern.endsWith("*")) {
// pattern: /druid* source:/druid/index.html
int length = pattern.length() - 1;
if (source.length() >= length) {
if (pattern.substring(0, length).equals(source.substring(0, length))) {
return true;
}
}
} else if (pattern.startsWith("*")) {
// pattern: *.html source:/xx/xx.html
int length = pattern.length() - 1;
if (source.length() >= length && source.endsWith(pattern.substring(1))) {
return true;
}
} else {
// pattern: /druid/index.html source:/druid/index.html
if (pattern.equals(source)) {
return true;
}
}
return false;
}
/**
* <p>
* three type: endsWithMatch(eg. /xxx*=/xxx/xyz), startsWithMatch(eg.
* *.xxx=abc.xxx), equals(eg. /xxx=/xxx).
* </p>
* <b>Notice</b>: *xxx* will match *xxxyyyy. endsWithMatch first.
*/
@Override
public boolean matches(String pattern, String source) {
if (pattern == null || source == null) {
return false;
}
pattern = pattern.trim();
source = source.trim();
if (pattern.endsWith("*")) {
// pattern: /druid* source:/druid/index.html
int length = pattern.length() - 1;
if (source.length() >= length) {
if (pattern.substring(0, length).equals(
source.substring(0, length))) {
return true;
}
}
} else if (pattern.startsWith("*")) {
// pattern: *.html source:/xx/xx.html
int length = pattern.length() - 1;
if (source.length() >= length
&& source.endsWith(pattern.substring(1))) {
return true;
}
} else if (pattern.contains("*")) {
// pattern: /druid/*/index.html source:/druid/admin/index.html
int start = pattern.indexOf("*");
int end = pattern.lastIndexOf("*");
if (source.startsWith(pattern.substring(0, start))
&& source.endsWith(pattern.substring(end + 1))) {
return true;
}
} else {
// pattern: /druid/index.html source:/druid/index.html
if (pattern.equals(source)) {
return true;
}
}
return false;
}
}
@@ -1,6 +1,7 @@
jdbc:derby:=org.apache.derby.jdbc.EmbeddedDriver
jdbc:mysql:=com.mysql.jdbc.Driver
jdbc:oracle:=oracle.jdbc.driver.OracleDriver
jdbc:mysql:=com.mysql.jdbc.Driver
jdbc:log4jdbc:=net.sf.log4jdbc.DriverSpy
jdbc:oracle:=oracle.jdbc.driver.OracleDriver
jdbc:microsoft:=com.microsoft.jdbc.sqlserver.SQLServerDriver
jdbc:jtds:=net.sourceforge.jtds.jdbc.Driver
jdbc:postgresql:=org.postgresql.Driver