分析阻断优化;修正代码生成选择多个验证条件的时候报错;
This commit is contained in:
@@ -39,9 +39,9 @@ public class CaptchaUtils {
|
|||||||
private static MarbleRippleFilterFactory mrff; // 大理石
|
private static MarbleRippleFilterFactory mrff; // 大理石
|
||||||
|
|
||||||
private static void initialize(){
|
private static void initialize(){
|
||||||
if (ccs == null || true){
|
if (ccs == null){
|
||||||
synchronized (CaptchaUtils.class) {
|
synchronized (CaptchaUtils.class) {
|
||||||
if (ccs == null || true){
|
if (ccs == null){
|
||||||
// 配置初始化
|
// 配置初始化
|
||||||
ccs = new ConfigurableCaptchaService();
|
ccs = new ConfigurableCaptchaService();
|
||||||
|
|
||||||
|
|||||||
@@ -736,7 +736,7 @@ public class FileUtils extends org.apache.commons.io.FileUtils {
|
|||||||
if (pastLength != 0) {
|
if (pastLength != 0) {
|
||||||
response.setHeader("Accept-Ranges", "bytes");// 如果是第一次下,还没有断点续传,状态是默认的 200,无需显式设置;响应的格式是:HTTP/1.1 200 OK
|
response.setHeader("Accept-Ranges", "bytes");// 如果是第一次下,还没有断点续传,状态是默认的 200,无需显式设置;响应的格式是:HTTP/1.1 200 OK
|
||||||
// 不是从最开始下载, 响应的格式是: Content-Range: bytes [文件块的开始字节]-[文件的总大小 - 1]/[文件的总大小]
|
// 不是从最开始下载, 响应的格式是: Content-Range: bytes [文件块的开始字节]-[文件的总大小 - 1]/[文件的总大小]
|
||||||
logger.debug("---------------不是从开始进行下载!服务器即将开始断点续传...");
|
logger.debug("服务器即将开始断点续传...");
|
||||||
switch (rangeSwitch) {
|
switch (rangeSwitch) {
|
||||||
case 1: { // 针对 bytes=27000- 的请求
|
case 1: { // 针对 bytes=27000- 的请求
|
||||||
String contentRange = new StringBuffer("bytes ").append(new Long(pastLength).toString()).append("-")
|
String contentRange = new StringBuffer("bytes ").append(new Long(pastLength).toString()).append("-")
|
||||||
@@ -753,9 +753,6 @@ public class FileUtils extends org.apache.commons.io.FileUtils {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// 是从开始下载
|
|
||||||
logger.debug("---------------是从开始进行下载!");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -798,7 +795,7 @@ public class FileUtils extends org.apache.commons.io.FileUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
out.flush();
|
out.flush();
|
||||||
logger.debug("---------------下载完成!");
|
logger.debug("下载完成!" + file.getAbsolutePath());
|
||||||
} catch (IOException ie) {
|
} catch (IOException ie) {
|
||||||
/**
|
/**
|
||||||
* 在写数据的时候, 对于 ClientAbortException 之类的异常,
|
* 在写数据的时候, 对于 ClientAbortException 之类的异常,
|
||||||
|
|||||||
@@ -438,9 +438,7 @@ public class VideoUtils {
|
|||||||
BufferedReader br = new BufferedReader(new InputStreamReader(__is));
|
BufferedReader br = new BufferedReader(new InputStreamReader(__is));
|
||||||
String line = null;
|
String line = null;
|
||||||
while ((line = br.readLine()) != null) {
|
while ((line = br.readLine()) != null) {
|
||||||
if (line != null){
|
log.debug(line);
|
||||||
log.debug(line);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -461,9 +459,7 @@ public class VideoUtils {
|
|||||||
BufferedReader br = new BufferedReader(new InputStreamReader(__is));
|
BufferedReader br = new BufferedReader(new InputStreamReader(__is));
|
||||||
String line = null;
|
String line = null;
|
||||||
while ((line = br.readLine()) != null) {
|
while ((line = br.readLine()) != null) {
|
||||||
if (line != null){
|
log.error(line);
|
||||||
log.error(line);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@@ -244,8 +244,9 @@ public class ClassUtils {
|
|||||||
if (test.matches(type)) {
|
if (test.matches(type)) {
|
||||||
matches.add((Class<?>) type);
|
matches.add((Class<?>) type);
|
||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Exception t) {
|
||||||
log.warn("Could not examine class '" + fqn + "'" + " due to a " + t.getClass().getName() + " with message: " + t.getMessage());
|
log.warn("Could not examine class '" + fqn + "'" + " due to a "
|
||||||
|
+ t.getClass().getName() + " with message: " + t.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -682,8 +683,12 @@ class DefaultVFS extends VFS {
|
|||||||
// Failure to read the stream means this is not a JAR
|
// Failure to read the stream means this is not a JAR
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
is.close();
|
if (is != null){
|
||||||
} catch (Exception e) {}
|
is.close();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -849,7 +849,7 @@ public class DiffMatchPatch {
|
|||||||
thisDiff = pointer.next();
|
thisDiff = pointer.next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (thisDiff != null) {
|
while (prevDiff != null && thisDiff != null) { // while (thisDiff != null) { ThinkGem
|
||||||
if (prevDiff.operation == Operation.DELETE &&
|
if (prevDiff.operation == Operation.DELETE &&
|
||||||
thisDiff.operation == Operation.INSERT) {
|
thisDiff.operation == Operation.INSERT) {
|
||||||
String deletion = prevDiff.text;
|
String deletion = prevDiff.text;
|
||||||
|
|||||||
@@ -409,33 +409,35 @@ public class ExcelImport {
|
|||||||
}
|
}
|
||||||
//log.debug("Import value type: ["+i+","+column+"] " + valType);
|
//log.debug("Import value type: ["+i+","+column+"] " + valType);
|
||||||
try {
|
try {
|
||||||
if (valType == String.class){
|
if (val != null){
|
||||||
String s = String.valueOf(val.toString());
|
if (valType == String.class){
|
||||||
if(StringUtils.endsWith(s, ".0")){
|
String s = String.valueOf(val.toString());
|
||||||
val = StringUtils.substringBefore(s, ".0");
|
if(StringUtils.endsWith(s, ".0")){
|
||||||
|
val = StringUtils.substringBefore(s, ".0");
|
||||||
|
}else{
|
||||||
|
val = String.valueOf(val.toString());
|
||||||
|
}
|
||||||
|
}else if (valType == Integer.class){
|
||||||
|
val = Double.valueOf(val.toString()).intValue();
|
||||||
|
}else if (valType == Long.class){
|
||||||
|
val = Double.valueOf(val.toString()).longValue();
|
||||||
|
}else if (valType == Double.class){
|
||||||
|
val = Double.valueOf(val.toString());
|
||||||
|
}else if (valType == Float.class){
|
||||||
|
val = Float.valueOf(val.toString());
|
||||||
|
}else if (valType == Date.class){
|
||||||
|
if (val instanceof String){
|
||||||
|
val = DateUtils.parseDate(val);
|
||||||
|
}else if (val instanceof Double){
|
||||||
|
val = DateUtil.getJavaDate((Double)val); // POI Excel 日期格式转换
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
val = String.valueOf(val.toString());
|
if (ef.fieldType() != Class.class){
|
||||||
}
|
val = ef.fieldType().getMethod("getValue", String.class).invoke(null, val.toString());
|
||||||
}else if (valType == Integer.class){
|
}else{
|
||||||
val = Double.valueOf(val.toString()).intValue();
|
val = Class.forName(this.getClass().getName().replaceAll(this.getClass().getSimpleName(),
|
||||||
}else if (valType == Long.class){
|
"fieldtype."+valType.getSimpleName()+"Type")).getMethod("getValue", String.class).invoke(null, val.toString());
|
||||||
val = Double.valueOf(val.toString()).longValue();
|
}
|
||||||
}else if (valType == Double.class){
|
|
||||||
val = Double.valueOf(val.toString());
|
|
||||||
}else if (valType == Float.class){
|
|
||||||
val = Float.valueOf(val.toString());
|
|
||||||
}else if (valType == Date.class){
|
|
||||||
if (val instanceof String){
|
|
||||||
val = DateUtils.parseDate(val);
|
|
||||||
}else if (val instanceof Double){
|
|
||||||
val = DateUtil.getJavaDate((Double)val); // POI Excel 日期格式转换
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
if (ef.fieldType() != Class.class){
|
|
||||||
val = ef.fieldType().getMethod("getValue", String.class).invoke(null, val.toString());
|
|
||||||
}else{
|
|
||||||
val = Class.forName(this.getClass().getName().replaceAll(this.getClass().getSimpleName(),
|
|
||||||
"fieldtype."+valType.getSimpleName()+"Type")).getMethod("getValue", String.class).invoke(null, val.toString());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
|||||||
@@ -110,28 +110,45 @@ public abstract class ExcelWriter {
|
|||||||
* @param entry the name of the sheet entry to substitute, e.g. xl/worksheets/sheet1.xml
|
* @param entry the name of the sheet entry to substitute, e.g. xl/worksheets/sheet1.xml
|
||||||
* @param out the stream to write the result to
|
* @param out the stream to write the result to
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("resource")
|
|
||||||
private static void substitute(File zipfile, File tmpfile, String entry,
|
private static void substitute(File zipfile, File tmpfile, String entry,
|
||||||
OutputStream out) throws IOException {
|
OutputStream out) throws IOException {
|
||||||
ZipFile zip = new ZipFile(zipfile);
|
ZipFile zip = null;
|
||||||
ZipOutputStream zos = new ZipOutputStream(out);
|
ZipOutputStream zos = null;
|
||||||
|
InputStream is = null;
|
||||||
@SuppressWarnings("unchecked")
|
try{
|
||||||
Enumeration<ZipEntry> en = (Enumeration<ZipEntry>) zip.entries();
|
zip = new ZipFile(zipfile);
|
||||||
while (en.hasMoreElements()) {
|
zos = new ZipOutputStream(out);
|
||||||
ZipEntry ze = en.nextElement();
|
@SuppressWarnings("unchecked")
|
||||||
if (!ze.getName().equals(entry)) {
|
Enumeration<ZipEntry> en = (Enumeration<ZipEntry>) zip.entries();
|
||||||
zos.putNextEntry(new ZipEntry(ze.getName()));
|
while (en.hasMoreElements()) {
|
||||||
InputStream is = zip.getInputStream(ze);
|
ZipEntry ze = en.nextElement();
|
||||||
copyStream(is, zos);
|
if (!ze.getName().equals(entry)) {
|
||||||
|
zos.putNextEntry(new ZipEntry(ze.getName()));
|
||||||
|
InputStream is2 = null;
|
||||||
|
try{
|
||||||
|
is2 = zip.getInputStream(ze);
|
||||||
|
copyStream(is2, zos);
|
||||||
|
}finally {
|
||||||
|
if (is2 != null){
|
||||||
|
is2.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
zos.putNextEntry(new ZipEntry(entry));
|
||||||
|
is = new FileInputStream(tmpfile);
|
||||||
|
copyStream(is, zos);
|
||||||
|
}finally {
|
||||||
|
if (is != null){
|
||||||
is.close();
|
is.close();
|
||||||
}
|
}
|
||||||
|
if (zos != null){
|
||||||
|
zos.close();
|
||||||
|
}
|
||||||
|
if (zip != null){
|
||||||
|
zip.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
zos.putNextEntry(new ZipEntry(entry));
|
|
||||||
InputStream is = new FileInputStream(tmpfile);
|
|
||||||
copyStream(is, zos);
|
|
||||||
is.close();
|
|
||||||
zos.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void copyStream(InputStream in, OutputStream out)
|
private static void copyStream(InputStream in, OutputStream out)
|
||||||
|
|||||||
@@ -214,15 +214,18 @@ public class WordExport {
|
|||||||
FileOutputStream fos = null;
|
FileOutputStream fos = null;
|
||||||
try {
|
try {
|
||||||
fos = new FileOutputStream(newFile);
|
fos = new FileOutputStream(newFile);
|
||||||
|
this.document.write(fos);
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
|
||||||
try {
|
|
||||||
this.document.write(fos);
|
|
||||||
fos.flush();
|
|
||||||
fos.close();
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
fos.flush();
|
||||||
|
fos.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,10 +74,12 @@ public class CodeStatistic {
|
|||||||
* @param f
|
* @param f
|
||||||
*/
|
*/
|
||||||
private static void count(File f) {
|
private static void count(File f) {
|
||||||
|
FileReader fr = null;
|
||||||
BufferedReader br = null;
|
BufferedReader br = null;
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
try {
|
try {
|
||||||
br = new BufferedReader(new FileReader(f));
|
fr = new FileReader(f);
|
||||||
|
br = new BufferedReader(fr);
|
||||||
String line = "";
|
String line = "";
|
||||||
while ((line = br.readLine()) != null) {
|
while ((line = br.readLine()) != null) {
|
||||||
line = line.trim(); // 除去注释前的空格
|
line = line.trim(); // 除去注释前的空格
|
||||||
@@ -113,6 +115,14 @@ public class CodeStatistic {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (fr != null){
|
||||||
|
try {
|
||||||
|
fr.close();
|
||||||
|
fr = null;
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -409,7 +409,7 @@ file:
|
|||||||
# 上传文件的相对路径(支持:yyyy, MM, dd, HH, mm, ss, E)
|
# 上传文件的相对路径(支持:yyyy, MM, dd, HH, mm, ss, E)
|
||||||
uploadPath: '{yyyy}{MM}/'
|
uploadPath: '{yyyy}{MM}/'
|
||||||
|
|
||||||
# 上传单个文件最大字节(500M),在这之上还有 > Tomcat限制 > Nginx限制,等。
|
# 上传单个文件最大字节(500M),在这之上还有 > Tomcat限制 > Nginx限制,等,此设置会覆盖 spring.http.multipart.maxFileSize 设置
|
||||||
maxFileSize: 500*1024*1024
|
maxFileSize: 500*1024*1024
|
||||||
|
|
||||||
#设置允许上传的文件后缀
|
#设置允许上传的文件后缀
|
||||||
|
|||||||
Reference in New Issue
Block a user