后台freemarker工具类

getFreemarkerContent(paramMap,template)

template:

 {
"reqTitle": "${Vo.title}",
"reqDescrip" : "测试描述",
"reqType" : "系统类",
"userName" : "<#list paramList as prop><#if prop.param == "develop">${prop.value}</#if></#list>",
"reqAnalyst" : "<#list paramList as prop><#if prop.param == "develop">${prop.value}</#if></#list>",
"developDuty" : "<#list paramList as prop><#if prop.param == "develop">${prop.value}</#if></#list>",
"itsmCode" : "${Vo.id}",
"cbgReq" : "否",
"benefitDepart" : "${ownerInfo.departmentId}",
"benefitDepartName" : "${ownerInfo.departmentName}",

}





import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.RenderingHints;
import java.awt.geom.RoundRectangle2D;
import java.awt.image.BufferedImage;
import java.awt.color.ColorSpace;
import java.awt.image.ColorConvertOp;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Reader;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
import java.net.HttpURLConnection;
import java.net.InetAddress;
import java.net.URL;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.security.MessageDigest;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


import javax.imageio.ImageIO;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import org.apache.commons.lang.CharUtils;
import org.quartz.TriggerUtils;
import org.quartz.impl.triggers.CronTriggerImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


import com.techsure.balantflow.common.Config;
import com.techsure.balantflow.dto.ActionVo;
import com.techsure.balantflow.dto.CalendarVo;
import com.techsure.balantflow.dto.notify.NotifyVo;


import freemarker.cache.StringTemplateLoader;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;


public class Toolkit {


private static Logger logger = LoggerFactory.getLogger(Toolkit.class);
private static String separator = System.getProperty("file.separator");
private static final char[] HEX_DIGITS = "0123456789abcdef".toCharArray();


public static boolean evaluateExpression(String expression, Map<String, Object> paramMap) {
ScriptEngineManager mgr = new ScriptEngineManager();
ScriptEngine engine = mgr.getEngineByName("JavaScript");
Iterator<Map.Entry<String, Object>> iter = paramMap.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry<String, Object> entry = iter.next();
engine.put(entry.getKey(), entry.getValue());
}
try {
return Boolean.parseBoolean(engine.eval(expression).toString());
} catch (ScriptException e) {
// logger.error(e.getMessage(), e);
e.printStackTrace();
}
return false;
}


public static String getExpireTime(Long expireTimeLong) {
if (expireTimeLong == null || expireTimeLong.equals(0L)) {
return null;
} else {
long lefttimelong = 0;
String str = "";
boolean timeOut = false;
if (expireTimeLong >= System.currentTimeMillis()) {
lefttimelong = expireTimeLong - System.currentTimeMillis();
} else {
lefttimelong = Math.abs(System.currentTimeMillis() - expireTimeLong);
timeOut = true;
}


lefttimelong = lefttimelong / 1000;
Long /* sec = null, */ min = null, hour = null, day = null;
/*
* if (lefttimelong > 0) { sec = lefttimelong % 60; }
*/
lefttimelong = lefttimelong / 60;
if (lefttimelong > 0) {
min = lefttimelong % 60;
}
lefttimelong = lefttimelong / 60;
if (lefttimelong > 0) {
hour = lefttimelong % 24;
}
lefttimelong = lefttimelong / 24;
if (lefttimelong > 0) {
day = lefttimelong;
}


if (day != null && day > 0) {
if (timeOut) {
str = "-" + day + "天";
} else {
str = day + "天";
}


return str;
}
if (hour != null && hour > 0) {
if (timeOut) {
str = "-" + hour + "小时";
return str;
} else {
str = hour + "小时";
}
}
if (min != null && min > 0) {
if (timeOut) {
if (str.length() <= 0)
str += "-";
str += min + "分";
} else {
str += min + "分";
}
return str;
}
}
return null;
}


public static boolean checkValueInArray(String[] array, String value) {
if (array == null || array.length == 0 || value == null) {
return false;
}
boolean bool = false;
for (String s : array) {
if (s.equals(value)) {
bool = true;
}
}
return bool;
}


/**
* 得到request payload里的数据
*
* @param req
* @return
*/
public static String getRequestPayload(HttpServletRequest req) {
StringBuilder sb = new StringBuilder();
try (BufferedReader reader = req.getReader();) {
char[] buff = new char[1024];
int len;
while ((len = reader.read(buff)) != -1) {
sb.append(buff, 0, len);
}
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
return sb.toString();
}


public static Map<String, Object> getRequestParams(HttpServletRequest request, String[] excludeParams) {
Map<String, String[]> requestParamMap = request.getParameterMap();
Iterator<Map.Entry<String, String[]>> iter = requestParamMap.entrySet().iterator();
Map<String, Object> paramMap = new LinkedHashMap<String, Object>();
while (iter.hasNext()) {
Map.Entry<String, String[]> entry = iter.next();
if (checkValueInArray(excludeParams, entry.getKey().toString())) {
continue;
}
if (entry.getValue().length == 1) {
if (!entry.getValue()[0].equals("")) {
paramMap.put(entry.getKey(), entry.getValue()[0]);
}
} else {
List<String> vList = new ArrayList<String>();
for (String p : entry.getValue()) {
if (!p.equals("")) {
vList.add(p);
}
}
if (vList.size() > 1) {
String[] newP = new String[vList.size()];
for (int i = 0; i < vList.size() - 1; i++) {
newP[i] = vList.get(i);
}
paramMap.put(entry.getKey(), newP);
} else if (vList.size() == 1) {
paramMap.put(entry.getKey(), vList.get(0));
}
}
}
return paramMap;
}


public static boolean isUrl(String URLName) {
HttpURLConnection con = null;
boolean isTrue = false;
try {
HttpURLConnection.setFollowRedirects(false);
con = (HttpURLConnection) new URL(URLName).openConnection();
con.setRequestMethod("HEAD");
isTrue = (con.getResponseCode() == HttpURLConnection.HTTP_OK);
} catch (Exception e) {
isTrue = false;
} finally {
con.disconnect();
}
return isTrue;
}


public static boolean validScript(String script) {
Reader reader = new InputStreamReader(Toolkit.class.getResourceAsStream("jquery.mask.js"));
ScriptEngineManager sem = new ScriptEngineManager();
ScriptEngine se = sem.getEngineByName("javascript");
try {
se.eval(reader);
se.eval("var customscript = (function() {" + script + "}());");
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
ex.printStackTrace();
return false;
}
return true;
}


/**
* @Author: Kelvin
* @Time:2014-7-24
* @Description: 生成TASK文件路径
* @param @param
*            taskId
* @param @return
* @return String
*/
public static String createTaskFilePath(Long taskId) {
String filePath = Config.TASK_PATH;
String ID = String.format("%09d", taskId);
for (int i = 0; i < 9; i += 3) {
filePath = filePath + separator + ID.substring(i, i + 3);
}
return filePath;
}


/**
* @Author: Kelvin
* @Time:2014-7-24
* @Description: 生成EOA文件路径
* @param @param
*            taskId
* @param @return
* @return String
*/
public static String creatEoaFilePath(Long taskId) {
String filePath = Config.EOA_PATH;
String ID = String.format("%09d", taskId);
for (int i = 0; i < 9; i += 3) {
filePath = filePath + separator + ID.substring(i, i + 3);
}
return filePath;
}


/**
* @Author: baron 2014-7-17
* @Description: 生成月份日历
*/
public static List<List<CalendarVo>> makeMonthCalendar(Calendar calendar, HashMap<String, Integer> taskMap) {
List<List<CalendarVo>> calendarList = new ArrayList<List<CalendarVo>>();


List<CalendarVo> titleList = new ArrayList<CalendarVo>();
List<CalendarVo> contentList = null;
CalendarVo calendarVo = null;
for (String string : Config.WEEKS) {
calendarVo = new CalendarVo();
calendarVo.setDate(string);
titleList.add(calendarVo);
}
calendarList.add(titleList);


int MONTH_NOW = calendar.get(Calendar.MONTH);
calendar.set(Calendar.DAY_OF_MONTH, 1);
int DAY_OF_WEEK_FIRST = calendar.get(Calendar.DAY_OF_WEEK);
int week = calendar.get(Calendar.WEEK_OF_MONTH);
for (int i = 1; i < DAY_OF_WEEK_FIRST; i++) {
if (i == 1) {
contentList = new ArrayList<CalendarVo>();
}
calendarVo = new CalendarVo();
contentList.add(calendarVo);
}
int day_of_week_now = 0;
int year_now = 0;
int month_now = 0;
int day_now = 0;
while (calendar.get(Calendar.MONTH) == MONTH_NOW) {
if (week != calendar.get(Calendar.WEEK_OF_MONTH)) {
week = calendar.get(Calendar.WEEK_OF_MONTH);
}
day_of_week_now = calendar.get(Calendar.DAY_OF_WEEK);
year_now = calendar.get(Calendar.YEAR);
month_now = calendar.get(Calendar.MONTH) + 1;
day_now = calendar.get(Calendar.DAY_OF_MONTH);
String date = year_now + "-" + (month_now >= 10 ? month_now : "0" + month_now) + "-" + (day_now >= 10 ? day_now : "0" + day_now);
if (day_of_week_now == 1) {
if (contentList != null)
calendarList.add(contentList);
contentList = new ArrayList<CalendarVo>();
}
calendarVo = new CalendarVo();
if (day_of_week_now == 1 || day_of_week_now == 7) {
calendarVo.setIsWeek(1);
} else {
calendarVo.setIsWeek(0);
}
calendarVo.setDate((day_now >= 10 ? day_now : "0" + day_now) + "");
calendarVo.setDateDesc(date);
calendarVo.setCount(taskMap.get(date) == null ? 0 : taskMap.get(date));
contentList.add(calendarVo);
calendar.add(Calendar.DAY_OF_MONTH, 1);
}
if (contentList != null)
calendarList.add(contentList);
return calendarList;
}


public static String encodeURIComponent(String s) {
String result = null;


try {
result = URLEncoder.encode(s, "UTF-8").replaceAll("\\+", "%20").replaceAll("\\%21", "!").replaceAll("\\%27", "'").replaceAll("\\%28", "(").replaceAll("\\%29", ")").replaceAll("\\%7E", "~");
} catch (UnsupportedEncodingException e) {
result = s;
}
return result;
}


public static String getExceptionStack(Exception e) {
StackTraceElement[] stackTraceElements = e.getStackTrace();
String result = e.toString() + "\n";
for (int index = stackTraceElements.length - 1; index >= 0; --index) {
result += "at [" + stackTraceElements[index].getClassName() + ",";
result += stackTraceElements[index].getFileName() + ",";
result += stackTraceElements[index].getMethodName() + ",";
result += stackTraceElements[index].getLineNumber() + "]\n";
}
return result;
}


public static String encodeHtml(String str) {
if (str != null && !"".equals(str)) {
str = str.replace("&", "&amp;");
str = str.replace("<", "&lt;");
str = str.replace(">", "&gt;");
str = str.replace("'", "&#39;");
str = str.replace("\"", "&quot;");
return str;
}
return "";
}


public static String translateLang(String sourceLang) {
String s = "aaa";
return s;
}


public static String removeHtml(String htmlStr) {
return removeHtml(htmlStr, null);
}


public static String removeHtml(String htmlStr, Integer length) {
final String regEx_script = "<script[^>]*?>[\\s\\S]*?<\\/script>"; // 定义script的正则表达式
final String regEx_style = "<style[^>]*?>[\\s\\S]*?<\\/style>"; // 定义style的正则表达式
final String regEx_html = "<[^>]+>"; // 定义HTML标签的正则表达式
Pattern p_script = Pattern.compile(regEx_script, Pattern.DOTALL | Pattern.CASE_INSENSITIVE);
Matcher m_script = p_script.matcher(htmlStr);
htmlStr = m_script.replaceAll(""); // 过滤script标签


Pattern p_style = Pattern.compile(regEx_style, Pattern.DOTALL | Pattern.CASE_INSENSITIVE);
Matcher m_style = p_style.matcher(htmlStr);
htmlStr = m_style.replaceAll(""); // 过滤style标签


Pattern p_html = Pattern.compile(regEx_html, Pattern.DOTALL | Pattern.CASE_INSENSITIVE);
Matcher m_html = p_html.matcher(htmlStr);
htmlStr = m_html.replaceAll(""); // 过滤html标签


if (length != null && length > 0) {
if (htmlStr.length() <= length) {
return htmlStr;
} else {
htmlStr = htmlStr.substring(0, length) + "...";
}
}
return htmlStr;
}


public static String decodeHtml(String str) {
if (str != null && !"".equals(str)) {
str = str.replace("&quot;", "\"");
str = str.replace("&#39;", "'");
str = str.replace("&gt;", ">");
str = str.replace("&lt;", "<");
str = str.replace("&amp;", "&");
return str;
}
return "";
}


/**
*
* @Author: baron 2014-1-18
* @Description: 得到分页页数
*/
public static int getPageCount(int rowNum, int pageSize) {
int pageCount = rowNum / pageSize + (rowNum % pageSize > 0 ? 1 : 0);
return pageCount;
}


public static int getMaxCount(int currentPage, int pageCount) {
return currentPage + 3 <= pageCount ? currentPage + 3 : pageCount;
}


public static int getMinCount(int currentPage, int pageCount) {
return currentPage - 3 >= 1 ? currentPage - 3 : 1;
}


public static boolean isNumeric(String str) {
for (int i = 0; i < str.length(); i++) {
if (!Character.isDigit(str.charAt(i))) {
return false;
}
}
return true;
}


public static boolean isLetter(String str) {
for (int i = 0; i < str.length(); i++) {
if (!CharUtils.isAsciiAlphanumeric(str.charAt(i)) && (int) str.charAt(i) != 95) {
return false;
}
}
return true;
}


/**
*
* @Author: baron 2014-1-18
* @Description: 得到分页起始数目
*/
public static int getStartNum(int currentPage, int pageSize) {
return (currentPage - 1) * pageSize;
}


/**
* @Author: baron 2014-1-20
* @Description: 写form表单信息
*/
public static void writeFormContent(Long formId, Integer formVersion, String content, String url) {
String filePath = url;
filePath += separator + formId;
File dirFile = new File(filePath);
if ((!dirFile.exists()) || (!dirFile.isDirectory())) {
dirFile.mkdirs();
}
boolean fileIsExists = false;
String contentFilePath = filePath + separator + formVersion + ".htm";
File desFile = new File(contentFilePath);
if ((!desFile.isFile()) || (!desFile.exists())) {
try {
fileIsExists = desFile.createNewFile();
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
} else {
fileIsExists = true;
}
if (fileIsExists) {
FileWriter fw = null;
try {
fw = new FileWriter(desFile);
fw.write(content);
} catch (IOException e) {
logger.error("write form file error : ", e.getMessage());
/*//ian180206反编出来的有,被供应商删掉了
        try
        {
          if (fw != null) {
            fw.close();
            fw = null;
          }
        } catch (IOException e) {
          logger.error("write form file error : ", e.getMessage());
        }
*/
} finally {
try {
if (fw != null) {
fw.close();
fw = null;
}
} catch (IOException e) {
logger.error("write form file error : ", e.getMessage());
}
}
}
}


/**
*
* @Author: baron 2014-1-20
* @Description: 读form file
*/
public static String readFormContent(String formID, String formVersion, String url) {
String filePath = url;
FileReader fr = null;
BufferedReader filebr = null;
String result = "";
try {
filePath += separator + formID;
File desFile = new File(filePath + separator + formVersion + ".htm");
if (desFile.isFile() && desFile.exists()) {
StringBuilder str = new StringBuilder();
fr = new FileReader(desFile);
filebr = new BufferedReader(fr);
String inLine = "";
while ((inLine = filebr.readLine()) != null) {
str.append(inLine + "\n");
}
result = str.toString();
} else {
result = "出错,找不到对应的表单文件!";
}
} catch (Exception e) {
logger.error("read form file error : ", e.getMessage());
result = e.getMessage();
/*ian180206反编出来的有,被供应商删掉了
      if (fr != null) {
        try {
          fr.close();
        } catch (IOException e) {
          logger.error(e.getMessage(), e);
        }
      }


      if (filebr != null)
        try {
          filebr.close();
        } catch (IOException e) {
          logger.error(e.getMessage(), e);
        }
*/
} finally {
if (fr != null) {
try {
fr.close();
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
}


if (filebr != null) {
try {
filebr.close();
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
}
}
return result;
}


/**
* @Author: baron 2014-1-25
* @Description: 解码
*/
public static String decoder(String str) {
try {
return URLDecoder.decode(str, "utf-8");
} catch (UnsupportedEncodingException e) {
logger.error("decode error :" + e.getMessage());
return str;
}
}


/**
*
* @Author: baron 2014-1-25
* @Description: 转码
*/
public static String encode(String str) {
try {
return URLEncoder.encode(str, "utf-8");
} catch (UnsupportedEncodingException e) {
logger.error("encode error :" + e.getMessage());
return str;
}
}


// 得到客户端IP
public static String getClientIpAddr(HttpServletRequest request) {
String ip = "-";
if (request != null) {
try {
ip = request.getHeader("X-Forwarded-For");
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("WL-Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("HTTP_CLIENT_IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("HTTP_X_FORWARDED_FOR");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getRemoteAddr();
}
if (ip != null && ip.equalsIgnoreCase("0:0:0:0:0:0:0:1")) {
ip = InetAddress.getLocalHost().getHostAddress().toString();
}
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
}
}
return ip;
}


// 得到服务器端的ip
public static String getServerIpAddress(HttpServletRequest request) {
String host = request.getServerName();
int port = request.getServerPort();
String scheme = request.getScheme();
return scheme + "://" + host + ":" + port;
}


// 注册到jstl的自定义函数
public static Boolean contains(Object obj1, Object obj) {
if (obj1 instanceof List) {
return ((List<Object>) obj1).contains(obj);
} else if (obj1 instanceof String) {
return obj1.toString().indexOf(obj.toString()) > -1;
} else {
return false;
}
}


public static String string2MD5(String inStr) {
MessageDigest md5 = null;
try {
md5 = MessageDigest.getInstance("MD5");
} catch (Exception e) {
logger.error(e.getMessage(), e);
return "";
}
char[] charArray = inStr.toCharArray();
byte[] byteArray = new byte[charArray.length];


for (int i = 0; i < charArray.length; i++)
byteArray[i] = (byte) charArray[i];
byte[] md5Bytes = md5.digest(byteArray);
StringBuffer hexValue = new StringBuffer();
for (int i = 0; i < md5Bytes.length; i++) {
int val = ((int) md5Bytes[i]) & 0xff;
if (val < 16)
hexValue.append("0");
hexValue.append(Integer.toHexString(val));
}
return hexValue.toString();
}


public static void showUserFace(String userID, String sex, String type, HttpServletRequest request, HttpServletResponse response) {
String systemUser = "SYSTEM";
InputStream in = null;
try {
File imgFile = null;
if (!userID.equals("") && !userID.equalsIgnoreCase(systemUser)) {
imgFile = new File(Config.USERFACE_PATH + Config.SEPARATOR + userID + Config.SEPARATOR + type + ".jpg");
if (imgFile.exists()) {
in = new FileInputStream(imgFile);
}
} else if (userID.equalsIgnoreCase(systemUser)) {
in = Toolkit.class.getClassLoader().getResourceAsStream("META-INF/resources/resources/images/defaultface/" + systemUser + "/" + type + ".jpg");
}


if (in == null) {
in = Toolkit.class.getClassLoader().getResourceAsStream("META-INF/resources/resources/images/defaultface/" + "default/" + type + "-" + sex + ".jpg");
}


BufferedImage image;
image = ImageIO.read(in);
ImageIO.write(image, "PNG", response.getOutputStream());
in.close();
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
}
/*//ian180206这是反编出来的
public static void getUserFace(String userID, String sex, String type, Integer online, HttpServletRequest request, HttpServletResponse response) {
String systemUser = "SYSTEM";
InputStream in = null;
try {
File imgFile = null;
if (!userID.equals("") && !userID.equalsIgnoreCase(systemUser)) {
imgFile = new File(Config.USERFACE_PATH + Config.SEPARATOR + userID + Config.SEPARATOR + type + ".jpg");
if (imgFile.exists()) {
in = new FileInputStream(imgFile);
}
} else if (userID.equalsIgnoreCase(systemUser)) {
in = Toolkit.class.getClassLoader().getResourceAsStream("META-INF/resources/resources/images/defaultface/" + systemUser + "/" + type + ".jpg");
}


// if (imgFile == null || !imgFile.exists()) {
if (in == null) {
in = Toolkit.class.getClassLoader().getResourceAsStream("META-INF/resources/resources/images/defaultface/" + "default/" + type + "-" + sex + ".jpg");
}


if (online != null && online.equals(1)) {
BufferedImage image;
// image = ImageIO.read(imgFile);
image = ImageIO.read(in);
ImageIO.write(image, "PNG", response.getOutputStream());
in.close();
} else {
// Image image = ImageIO.read(imgFile);
Image image = ImageIO.read(in);
int srcH = image.getHeight(null);
int srcW = image.getWidth(null);
BufferedImage bufferedImage = new BufferedImage(srcW, srcH, BufferedImage.TYPE_3BYTE_BGR);
bufferedImage.getGraphics().drawImage(image, 0, 0, srcW, srcH, null);
bufferedImage = new ColorConvertOp(ColorSpace.getInstance(ColorSpace.CS_GRAY), null).filter(bufferedImage, null);
ImageIO.write(bufferedImage, "PNG", response.getOutputStream());
in.close();
}
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
}
*/


//ian180206这是供应商的
@SuppressWarnings("resource")
public static void getUserFace(String userID, String sex, String type, Integer online, HttpServletRequest request, HttpServletResponse response) {
String systemUser = "SYSTEM";
InputStream in = null;
try {
File imgFile = null;
if (!userID.equals("") && !userID.equalsIgnoreCase(systemUser)) {
imgFile = new File(Config.USERFACE_PATH + Config.SEPARATOR + userID + Config.SEPARATOR + type + ".jpg");
if (imgFile.exists()) {
in = new FileInputStream(imgFile);
}
} else if (userID.equalsIgnoreCase(systemUser)) {
in = Toolkit.class.getClassLoader().getResourceAsStream("META-INF/resources/resources/images/defaultface/" + systemUser + "/" + type + ".jpg");
}


// if (imgFile == null || !imgFile.exists()) {
if (in == null) {
in = Toolkit.class.getClassLoader().getResourceAsStream("META-INF/resources/resources/images/defaultface/" + "default/" + type + "-" + sex + ".jpg");
}
BufferedImage userImg, iconImg;
userImg = ImageIO.read(in);
if ("small".equals(type)) {
userImg = zipWidthHeightImageFile(userImg, 48, 48, "round");
} else if ("big".equals(type)) {
userImg = zipWidthHeightImageFile(userImg, 85, 105, "rect");


}
if (online != null && online.equals(1)) {
in = Toolkit.class.getClassLoader().getResourceAsStream("META-INF/resources/resources/images/defaultface/icon/online-" + type + ".png");
} else {
in = Toolkit.class.getClassLoader().getResourceAsStream("META-INF/resources/resources/images/defaultface/icon/offline-" + type + ".png");
}
iconImg = ImageIO.read(in);
Graphics2D graphics = userImg.createGraphics();
if ("small".equals(type)) {
graphics.drawImage(iconImg, userImg.getWidth() - iconImg.getWidth(), userImg.getHeight() - iconImg.getHeight(), iconImg.getWidth(), iconImg.getHeight(), null);
} else if ("big".equals(type)) {
graphics.drawImage(iconImg, userImg.getWidth() - iconImg.getWidth() - 2, userImg.getHeight() - iconImg.getHeight() - 2, iconImg.getWidth(), iconImg.getHeight(), null);
}
graphics.dispose();
// iconImg = ImageIO.read(in);
// userImg = modifyImage(userImg, iconImg);
ImageIO.write(userImg, "png", response.getOutputStream());
in.close();
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
}


// public static BufferedImage modifyImage(BufferedImage userImg,
// BufferedImage iconImg) {
//
// }


public static BufferedImage zipWidthHeightImageFile(BufferedImage userImg, int width, int height, String type) {
BufferedImage buffImg = null;
try {
/** 对服务器上的临时文件进行处理 */
// srcFile = ImageIO.read(file);
buffImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
Graphics2D graphics = buffImg.createGraphics();
if ("round".equals(type)) {
graphics.setComposite(AlphaComposite.Src);
graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
graphics.setColor(Color.WHITE);
graphics.fill(new RoundRectangle2D.Float(0, 0, width, height, 50, 50));
graphics.setComposite(AlphaComposite.SrcAtop);
}
graphics.drawImage(userImg.getScaledInstance(width, height, Image.SCALE_SMOOTH), 0, 0, null);
graphics.dispose();
} catch (Exception e) {
e.printStackTrace();
} finally {
if (userImg != null) {
userImg.flush();
}
if (buffImg != null) {
buffImg.flush();
}


}
return buffImg;
}


public static Long getTimestamp(String date, String format) {
if (date == null || date.equals("")) {
return null;
}
long time = 0L;
Calendar calendar = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(format);
try {
calendar.setTime(sdf.parse(date));
} catch (ParseException e) {
logger.error(e.getMessage(), e);
}
time = calendar.getTimeInMillis();
return time;
}


public static long getSystemDateTimeStamp() {
Calendar calendar = Calendar.getInstance();
return calendar.getTimeInMillis();
}


public static String getDateTimeStr(Long timestap, String format) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(timestap);
SimpleDateFormat sdf = new SimpleDateFormat(format);
sdf.format(calendar.getTime());
return sdf.format(calendar.getTime());
}


public static String getCurrentDateTimeStr(String format) {
Calendar calendar = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(format);
return sdf.format(calendar.getTime());
}


public static Date getString2Date(String dateStr, String format) {
Calendar calendar = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(format);
try {
calendar.setTime(sdf.parse(dateStr));
} catch (ParseException e) {
logger.error(e.getMessage(), e);
}
return calendar.getTime();
}


/**
* 判断是否是含有null的list
*
* @param list
* @return
*/
public static boolean isListOfNulls(List<?> list) {
if (list != null) {
for (Object o : list)
if (o != null)
return false;
return true;
} else {
return false;
}
}


/**
* 判断请求是通过点击链接还是直接输入网址 author wangpf
*
* @param request
* @return
*/
public static boolean isFromClickUrl(HttpServletRequest request) {
String refer = request.getHeader("Referer");
String host = request.getHeader("Host");
if (host != null) {
if (refer == null || "".equals(refer)) {
// 此情况为在浏览器中输入地址
return false;
} else {
String[] urls = refer.split("//");
if (urls != null && urls.length > 1) {
String tmpHost = urls[1].substring(0, urls[1].indexOf("/"));
// 判断是否是从我们的主机发起的请求
if (host.equals(tmpHost))
return true;
else
return false;
}
}
}
return false;
}


public static String unescape(String s) {
StringBuffer sbuf = new StringBuffer();
int i = 0;
int len = s.length();


while (i < len) {
int ch = s.charAt(i);
// if (ch == '+') { // + : map to ' '
// //sbuf.append(' ');
// } else
if ('A' <= ch && ch <= 'Z') { // 'A'..'Z' : as it was
sbuf.append((char) ch);
} else if ('a' <= ch && ch <= 'z') { // 'a'..'z' : as it was
sbuf.append((char) ch);
} else if ('0' <= ch && ch <= '9') { // '0'..'9' : as it was
sbuf.append((char) ch);
} else if (ch == '-' || ch == '+' || ch == '/' || ch == '_' // unreserved
// : as
// it
// was
|| ch == '.' || ch == '!'


|| ch == '~' || ch == '*' || ch == '\'' || ch == '(' || ch == ')' || ch == '@') {
sbuf.append((char) ch);
} else if (ch == '%') {
int cint = 0;
if ('u' != s.charAt(i + 1)) { // %XX : map to ascii(XX)
cint = (cint << 4) | val[s.charAt(i + 1)];


cint = (cint << 4) | val[s.charAt(i + 2)];
i += 2;
} else { // %uXXXX : map to unicode(XXXX)
cint = (cint << 4) | val[s.charAt(i + 2)];


cint = (cint << 4) | val[s.charAt(i + 3)];
cint = (cint << 4) | val[s.charAt(i + 4)];
cint = (cint << 4) | val[s.charAt(i + 5)];
i += 5;
}
sbuf.append((char) cint);
}


i++;
}
return sbuf.toString();
}


public static String escape(String s) {
StringBuffer sbuf = new StringBuffer();
int len = s.length();
for (int i = 0; i < len; i++) {
int ch = s.charAt(i);
// if (ch == ' ') { // space : map to '+'
// sbuf.append('+');
// } else
if ('A' <= ch && ch <= 'Z') { // 'A'..'Z' : as it was
sbuf.append((char) ch);
} else if ('a' <= ch && ch <= 'z') { // 'a'..'z' : as it was


sbuf.append((char) ch);
} else if ('0' <= ch && ch <= '9') { // '0'..'9' : as it was
sbuf.append((char) ch);
} else if (ch == '-' || ch == '_' // unreserved : as it was
|| ch == '.' || ch == '!' || ch == '~' || ch == '*' || ch == '\'' || ch == '(' || ch == ')' || ch == '@') {
sbuf.append((char) ch);
} else if (ch <= 0x007F) { // other ASCII : map to %XX
sbuf.append('%');
sbuf.append(hex[ch]);
} else { // unicode : map to %uXXXX


sbuf.append('%');
sbuf.append('u');
sbuf.append(hex[(ch >>> 8)]);
sbuf.append(hex[(0x00FF & ch)]);
}
}
return sbuf.toString();
}


public static String replaceEnter(String str) {
if (str != null) {
return str.replace("\r\n", "<br>").replace("\r", "<br>").replace("\n", "<br>");
} else {
return "";
}
}


public static String convertString(String s) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
switch (c) {
case '"':
sb.append("\"");
break;
case '/':
sb.append("\\/");
break;
case '\b':
sb.append("\\b");
break;
case '\f':
sb.append("\\f");
break;
case '\n':
sb.append("\\n");
break;
case '\r':
sb.append("\\r");
break;
case '\t':
sb.append("\\t");
break;
default:
sb.append(c);
}
}
System.out.println(sb.toString());
return sb.toString();
}


private final static String[] hex = { "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0A", "0B", "0C", "0D", "0E", "0F", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1A", "1B", "1C", "1D", "1E", "1F", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2A", "2B", "2C", "2D", "2E", "2F",


"30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3A", "3B", "3C", "3D", "3E", "3F", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4A", "4B", "4C", "4D", "4E", "4F", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5A", "5B", "5C", "5D", "5E", "5F",


"60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6A", "6B", "6C", "6D", "6E", "6F", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7A", "7B", "7C", "7D", "7E", "7F", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8A", "8B", "8C", "8D", "8E", "8F", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9A", "9B", "9C", "9D", "9E", "9F",


"A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "AA", "AB", "AC", "AD", "AE", "AF", "B0", "B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9", "BA", "BB", "BC", "BD", "BE", "BF", "C0", "C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9", "CA", "CB", "CC", "CD", "CE", "CF", "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", "D8", "D9", "DA", "DB", "DC", "DD", "DE", "DF", "E0", "E1", "E2", "E3", "E4", "E5", "E6", "E7", "E8", "E9", "EA", "EB", "EC", "ED", "EE", "EF", "F0", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "FA", "FB", "FC", "FD", "FE", "FF" };


private final static byte[] val = { 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,


0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F };


/**
* List序列化深度克隆
*/
@SuppressWarnings("unchecked")
public static <T> List<T> ListDeepClone(List<T> src) {
ByteArrayOutputStream byteOut = null;
ObjectOutputStream out = null;
ByteArrayInputStream byteIn = null;
ObjectInputStream in = null;
List<T> resultList = null;
try {
byteOut = new ByteArrayOutputStream();
out = new ObjectOutputStream(byteOut);
out.writeObject(src);
byteIn = new ByteArrayInputStream(byteOut.toByteArray());
in = new ObjectInputStream(byteIn);
resultList = (List<T>) in.readObject();
} catch (IOException | ClassNotFoundException e) {
logger.error(e.getMessage(), e);
} finally {
if (byteIn != null) {
try {
byteIn.close();
} catch (IOException e) {
e.printStackTrace();
logger.error(e.getMessage());
}
}
if (in != null) {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
logger.error(e.getMessage());
}
}
if (byteOut != null) {
try {
byteOut.close();
} catch (IOException e) {
e.printStackTrace();
logger.error(e.getMessage());
}
}
if (out != null) {
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
logger.error(e.getMessage());
}
}
}
return resultList;
}


/**
* 对象序列化深度克隆
*/
public static Object ObjectClone(Object obj) {
ByteArrayOutputStream byteOut = null;
ObjectOutputStream out = null;
ByteArrayInputStream byteIn = null;
ObjectInputStream in = null;
Object newObj = null;
try {
byteOut = new ByteArrayOutputStream();
out = new ObjectOutputStream(byteOut);
out.writeObject(obj);
byteIn = new ByteArrayInputStream(byteOut.toByteArray());
in = new ObjectInputStream(byteIn);
newObj = in.readObject();
} catch (IOException | ClassNotFoundException e) {
logger.error(e.getMessage(), e);
} finally {
if (byteIn != null) {
try {
byteIn.close();
} catch (IOException e) {
e.printStackTrace();
logger.error(e.getMessage());
}
}
if (in != null) {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
logger.error(e.getMessage());
}
}
if (byteOut != null) {
try {
byteOut.close();
} catch (IOException e) {
e.printStackTrace();
logger.error(e.getMessage());
}
}
if (out != null) {
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
logger.error(e.getMessage());
}
}
}
return newObj;
}


public static String getFreemarkerContent(Map<String, Object> paramMap, String content) throws IOException, TemplateException {
String resultStr = "";
if (content != null) {
Configuration cfg = new Configuration();
cfg.setNumberFormat("0.##");
cfg.setClassicCompatible(true);
StringTemplateLoader stringLoader = new StringTemplateLoader();
stringLoader.putTemplate("template", content);
cfg.setTemplateLoader(stringLoader);
Template temp;
Writer out = null;
try {
temp = cfg.getTemplate("template", "utf-8");
out = new StringWriter();
temp.process(paramMap, out);
resultStr = out.toString();
out.flush();
} catch (IOException e) {
logger.error(e.getMessage(), e);
throw e;
} catch (TemplateException e) {
logger.error(e.getMessage(), e);
throw e;
}
}
return resultStr;
}


public static String getFreemarkerContent(ActionVo newAction, String content) {
String resultStr = "";
if (content != null) {
Configuration cfg = new Configuration();
cfg.setNumberFormat("0.##");
cfg.setClassicCompatible(true);
StringTemplateLoader stringLoader = new StringTemplateLoader();
stringLoader.putTemplate("template", content);
cfg.setTemplateLoader(stringLoader);
Template temp;
Writer out = null;
try {
temp = cfg.getTemplate("template", "utf-8");
out = new StringWriter();
temp.process(newAction, out);
resultStr = out.toString();
out.flush();
} catch (IOException e) {
logger.error(e.getMessage(), e);
} catch (TemplateException e) {
logger.error(e.getMessage(), e);
}
}
return resultStr;
}


public static String getFreemakerContent(NotifyVo notifyVo, String content) {
String resultStr = "";
if (content != null) {
Configuration cfg = new Configuration();
cfg.setNumberFormat("0.##");
cfg.setClassicCompatible(true);
StringTemplateLoader stringLoader = new StringTemplateLoader();
stringLoader.putTemplate("template", content);
cfg.setTemplateLoader(stringLoader);
Template temp;
Writer out = null;
try {
temp = cfg.getTemplate("template", "utf-8");
out = new StringWriter();
temp.process(notifyVo, out);
resultStr = out.toString();
out.flush();
} catch (IOException e) {
logger.error(e.getMessage(), e);
resultStr = content;
} catch (TemplateException e) {
logger.error(e.getMessage(), e);
resultStr = content;
}
}
return resultStr;
}


public static String getMailTemplateStyle() {
StringBuilder sb = new StringBuilder("<style type=\"text/css\">.table { width: 100%; background:#99CCFF; border-collapse:collapse; mso-border-alt:outset #555555 .75pt; mso-yfti-tbllook:1184; mso-padding-alt:3.75pt 3.75pt 3.75pt 3.75pt }.table td {border: 1px solid black;}.table .tdleft{width: 10%; text-align: center;word-break : break-all;}.table .tdright{width : 90%;text-align: left;}</style>");
return sb.toString();
}


public static String clearStringHTML(String sourceContent) {
String content = "";
if (sourceContent != null) {
content = sourceContent.replaceAll("</?[^>]+>", "");
}
return content;
}


public static String clearStringHTMLForSms(String sourceContent) {
if (sourceContent != null && !"".equals(sourceContent)) {
String content = clearStringHTML(sourceContent);
if (!content.equals("")) {
Pattern p = Pattern.compile("\\s*|\t|\r|\n");
Matcher m = p.matcher(content);
String after = m.replaceAll("");
return after;
}
return content;
}
return "";
}


// jstl内用到的函数
public static String getRandom(Integer rand) {
if (rand == null)
rand = 10000;
Integer number = (int) (Math.random() * rand);
if (number < 100)
return "000" + number;
else if (number < 1000)
return "00" + number;
else
return number.toString();
}


public Boolean ContainForJstl(List<Object> list, Object obj) {
if (list == null || list.size() == 0 || obj == null) {
return false;
}
return list.contains(obj);
}


/*
* 获取动态param
*/
public static Map<String, Object> getParamMap(HttpServletRequest request) {
Map<String, String[]> requestParamMap = request.getParameterMap();
Iterator<Map.Entry<String, String[]>> iter = requestParamMap.entrySet().iterator();
Map<String, Object> paramMap = new TreeMap<String, Object>();
while (iter.hasNext()) {
Map.Entry<String, String[]> entry = iter.next();
if (entry.getValue().length == 1) {
if (!entry.getValue()[0].equals("")) {
paramMap.put(entry.getKey(), entry.getValue()[0]);
}
} else {
List<String> vList = new ArrayList<String>();
for (String p : entry.getValue()) {
if (!p.equals("")) {
vList.add(p);
}
}
if (vList.size() > 1) {
String[] newP = new String[vList.size()];
for (int i = 0; i < vList.size(); i++) {
newP[i] = vList.get(i);
}
paramMap.put(entry.getKey(), newP);
} else if (vList.size() == 1) {
paramMap.put(entry.getKey(), vList.get(0));
}
}


}
return paramMap;
}


/**
* 获取文件的MD5
*/
public static String getFileMD5(String path) {
File file = new File(path);
if (!file.isFile()) {
return null;
}
MessageDigest digest = null;
FileInputStream in = null;
byte buffer[] = new byte[1024];
int len;
try {
digest = MessageDigest.getInstance("MD5");
in = new FileInputStream(file);
while ((len = in.read(buffer, 0, 1024)) != -1) {
digest.update(buffer, 0, len);
}
in.close();
} catch (Exception e) {
e.printStackTrace();
return null;
}
return toHex(digest.digest());
}


public static String toHex(byte[] data) {
char[] chars = new char[data.length * 2];
for (int i = 0; i < data.length; i++) {
chars[i * 2] = HEX_DIGITS[(data[i] >> 4) & 0xf];
chars[i * 2 + 1] = HEX_DIGITS[data[i] & 0xf];
}
return new String(chars);
}


public static String getCornExpressNextFireTime(String cron , String format) {
CronTriggerImpl cronTriggerImpl = new CronTriggerImpl();
List<Date> dates = null;
SimpleDateFormat dateFormat = null;
try {
cronTriggerImpl.setCronExpression(cron);
Calendar calendar = Calendar.getInstance();
Date now = calendar.getTime();
calendar.add(Calendar.MONDAY, 1);// 把统计的区间段往后推1个月
dates = TriggerUtils.computeFireTimesBetween(cronTriggerImpl, null, now, calendar.getTime());
dateFormat = new SimpleDateFormat(format);
} catch (ParseException e) {
e.printStackTrace();
logger.error(e.getMessage(), e);
}
if (dates != null && dates.size() > 0)
return dateFormat.format(dates.get(0));
else
return null;
}

/**
* 判断ip是否在网段(CIDR)里
* @param ip
* @param networkSegment
* @return
*/
public static boolean checkIpInNetworkSegement(String ip, String networkSegment) {
boolean result = false;
if(networkSegment!=null && !"".equals(networkSegment)){
try {
IPv4 ipv4 = new IPv4(networkSegment);
return ipv4.contains(ip);
} catch (NumberFormatException e) {
result = false;
}
}


return result;
}


/**
* 判断地址是否是ip
* @param addr
* @return
*/
public static boolean isIP(String addr)
{
if(addr.length() < 7 || addr.length() > 15 || "".equals(addr))
{
return false;
}
/**
* 判断IP格式和范围
*/
String rexp = "([1-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}";

Pattern pat = Pattern.compile(rexp);  

Matcher mat = pat.matcher(addr);  

boolean isIpAddress = mat.find();


return isIpAddress;
}


}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值