【fix sonar】CommonUtils文件

This commit is contained in:
梁琦涛
2023-03-08 15:45:16 +08:00
parent 19c5eff30c
commit 700d3001cf
@@ -97,10 +97,7 @@ public class CommonUtils {
return false; return false;
}else{ }else{
Matcher m = ZHONGWEN_PATTERN.matcher(str); Matcher m = ZHONGWEN_PATTERN.matcher(str);
if (m.find()) { return m.find();
return true;
}
return false;
} }
} }
@@ -256,8 +253,7 @@ public class CommonUtils {
*/ */
public static boolean limitFileSuffix(String fileName,String[] fileSuffixLimits){ public static boolean limitFileSuffix(String fileName,String[] fileSuffixLimits){
final List<String> fileNameList = Arrays.asList(fileSuffixLimits); final List<String> fileNameList = Arrays.asList(fileSuffixLimits);
boolean isExists = fileNameList.stream().anyMatch(name -> fileName.substring(0,fileName.lastIndexOf('.')).contains(name)||fileName.substring(fileName.lastIndexOf('.')).equals(name)); return fileNameList.stream().anyMatch(name -> fileName.substring(0,fileName.lastIndexOf('.')).contains(name)||fileName.substring(fileName.lastIndexOf('.')).equals(name));
return isExists;
} }
/** /**
* RSA 使用私钥解密 * RSA 使用私钥解密