mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
monitor client support
This commit is contained in:
@@ -29,6 +29,8 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.servlet.GenericServlet;
|
||||
|
||||
public class Utils {
|
||||
|
||||
public final static int DEFAULT_BUFFER_SIZE = 1024 * 4;
|
||||
@@ -168,6 +170,16 @@ public class Utils {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Boolean getBoolean(GenericServlet servlet, String key) {
|
||||
String property = servlet.getInitParameter(key);
|
||||
if ("true".equals(property)) {
|
||||
return Boolean.TRUE;
|
||||
} else if ("false".equals(property)) {
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Integer getInteger(Properties properties, String key) {
|
||||
String property = properties.getProperty(key);
|
||||
|
||||
Reference in New Issue
Block a user