SonarLint
This commit is contained in:
parent
0cc8a03c59
commit
29ed97b163
@ -2,19 +2,10 @@
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="52b7c556-aac6-402c-b840-5f2564f1f5d7" name="Default" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/encodings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/encodings.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/1/c/1c975fc549020abdaa84eed8958c340de82c46ba" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/4/4/442292b8a7efeabbe4cc176709b833b1792140ec" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/7/5/752ec767523fc44d876b82408ca379fab24b78f4" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/8/e/8ec9a00bfd09b3190ac6b22251dbb1aa95a0579d" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/sonarlint/issuestore/index.pb" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/vcs.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/site/cnkj/utils/config/AsyncExecutePool.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/site/cnkj/utils/config/AsyncExecutePool.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/site/cnkj/utils/config/AsyncThreadPoolConfig.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/site/cnkj/utils/config/AsyncThreadPoolConfig.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/site/cnkj/utils/service/ActuatorInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/site/cnkj/utils/service/ActuatorInfo.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/site/cnkj/utils/FileEncryptDecrypt.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/site/cnkj/utils/FileEncryptDecrypt.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/site/cnkj/utils/FileUtil.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/site/cnkj/utils/FileUtil.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/site/cnkj/utils/HttpCommonUtil.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/site/cnkj/utils/HttpCommonUtil.java" afterDir="false" />
|
||||
</list>
|
||||
<ignored path="$PROJECT_DIR$/target/" />
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
@ -26,11 +17,11 @@
|
||||
</component>
|
||||
<component name="FileEditorManager">
|
||||
<leaf>
|
||||
<file leaf-file-name="ActuatorInfo.java" pinned="false" current-in-tab="true">
|
||||
<file leaf-file-name="ActuatorInfo.java" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/site/cnkj/utils/service/ActuatorInfo.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="285">
|
||||
<caret line="38" column="32" selection-start-line="38" selection-start-column="32" selection-end-line="38" selection-end-column="32" />
|
||||
<state relative-caret-position="445">
|
||||
<caret line="46" selection-start-line="46" selection-end-line="46" />
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
@ -38,6 +29,64 @@
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="StringUtil.java" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/site/cnkj/utils/StringUtil.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="347">
|
||||
<caret line="107" column="36" selection-start-line="107" selection-start-column="36" selection-end-line="107" selection-end-column="36" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="DataResult.java" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/site/cnkj/utils/domain/DataResult.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="140">
|
||||
<caret line="8" selection-start-line="8" selection-end-line="8" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="RedisUtil.java" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/site/cnkj/utils/RedisUtil.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="520">
|
||||
<caret line="32" column="32" lean-forward="true" selection-start-line="32" selection-start-column="32" selection-end-line="32" selection-end-column="32" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="FileEncryptDecrypt.java" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/site/cnkj/utils/FileEncryptDecrypt.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="200">
|
||||
<caret line="84" column="37" lean-forward="true" selection-start-line="84" selection-start-column="37" selection-end-line="84" selection-end-column="37" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="FileUtil.java" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/site/cnkj/utils/FileUtil.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="268">
|
||||
<caret line="37" column="37" lean-forward="true" selection-start-line="37" selection-start-column="37" selection-end-line="37" selection-end-column="37" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="HttpCommonUtil.java" pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/site/cnkj/utils/HttpCommonUtil.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="428">
|
||||
<caret line="65" column="39" selection-start-line="65" selection-start-column="39" selection-end-line="65" selection-end-column="39" />
|
||||
<folding>
|
||||
<element signature="e#1958#1959#0" expanded="true" />
|
||||
<element signature="e#1994#1995#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="pom.xml" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/pom.xml">
|
||||
<provider editor-type-id="MavenHelperPluginDependencyAnalyzer" />
|
||||
@ -59,6 +108,10 @@
|
||||
<option value="$PROJECT_DIR$/src/main/java/site/cnkj/utils/config/AsyncExecutePool.java" />
|
||||
<option value="$PROJECT_DIR$/src/main/java/site/cnkj/utils/service/ActuatorInfo.java" />
|
||||
<option value="$PROJECT_DIR$/pom.xml" />
|
||||
<option value="$PROJECT_DIR$/src/main/java/site/cnkj/utils/StringUtil.java" />
|
||||
<option value="$PROJECT_DIR$/src/main/java/site/cnkj/utils/FileEncryptDecrypt.java" />
|
||||
<option value="$PROJECT_DIR$/src/main/java/site/cnkj/utils/FileUtil.java" />
|
||||
<option value="$PROJECT_DIR$/src/main/java/site/cnkj/utils/HttpCommonUtil.java" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
@ -95,7 +148,9 @@
|
||||
<option name="width" value="1693" />
|
||||
<option name="height" value="1056" />
|
||||
</component>
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
|
||||
<ConfirmationsSetting value="2" id="Add" />
|
||||
</component>
|
||||
<component name="ProjectView">
|
||||
<navigator proportions="" version="1">
|
||||
<foldersAlwaysOnTop value="true" />
|
||||
@ -162,6 +217,7 @@
|
||||
<property name="LombokPluginIS_LOMBOK_VERSION_CHECK_Enabled" value="false" />
|
||||
<property name="LombokPluginIS_MISSING_LOMBOK_CHECK_Enabled" value="true" />
|
||||
<property name="LombokPluginIS_VAL_Enabled" value="true" />
|
||||
<property name="SONARLINT_PRECOMMIT_ANALYSIS" value="true" />
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="aspect.path.notification.shown" value="true" />
|
||||
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
|
||||
@ -184,6 +240,17 @@
|
||||
</option>
|
||||
</component>
|
||||
<component name="RunManager">
|
||||
<configuration name="HttpCommonUtil" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
||||
<option name="MAIN_CLASS_NAME" value="site.cnkj.utils.HttpCommonUtil" />
|
||||
<module name="CommonUtil" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<extension name="coverage">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="site.cnkj.utils.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
</configuration>
|
||||
<configuration default="true" type="Application" factoryName="Application">
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
</configuration>
|
||||
@ -225,6 +292,11 @@
|
||||
<properties />
|
||||
<listeners />
|
||||
</configuration>
|
||||
<recent_temporary>
|
||||
<list>
|
||||
<item itemvalue="Application.HttpCommonUtil" />
|
||||
</list>
|
||||
</recent_temporary>
|
||||
</component>
|
||||
<component name="SvnConfiguration">
|
||||
<configuration />
|
||||
@ -236,12 +308,20 @@
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1574318981558</updated>
|
||||
<workItem from="1574318985781" duration="809000" />
|
||||
<workItem from="1574318985781" duration="2238000" />
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="repair some lombok questions">
|
||||
<created>1574320188766</created>
|
||||
<option name="number" value="00001" />
|
||||
<option name="presentableId" value="LOCAL-00001" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1574320188766</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="2" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TimeTrackingManager">
|
||||
<option name="totallyTimeSpent" value="809000" />
|
||||
<option name="totallyTimeSpent" value="2238000" />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
|
||||
@ -260,7 +340,7 @@
|
||||
<window_info id="UI Designer" />
|
||||
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
|
||||
<window_info anchor="bottom" id="TODO" order="6" />
|
||||
<window_info active="true" anchor="bottom" id="Messages" visible="true" weight="0.3293348" />
|
||||
<window_info anchor="bottom" id="Messages" weight="0.3293348" />
|
||||
<window_info anchor="right" id="Palette	" />
|
||||
<window_info id="Image Layers" />
|
||||
<window_info anchor="right" id="Capture Analysis" />
|
||||
@ -268,9 +348,9 @@
|
||||
<window_info anchor="bottom" id="Run" order="2" />
|
||||
<window_info anchor="bottom" id="Spring" />
|
||||
<window_info anchor="bottom" id="Terminal" />
|
||||
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.25" />
|
||||
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.20415778" />
|
||||
<window_info anchor="right" id="Bean Validation" />
|
||||
<window_info anchor="bottom" id="SonarLint" />
|
||||
<window_info active="true" anchor="bottom" id="SonarLint" visible="true" weight="0.3293348" />
|
||||
<window_info anchor="right" id="Theme Preview" />
|
||||
<window_info id="Favorites" side_tool="true" />
|
||||
<window_info anchor="bottom" id="Find" order="1" />
|
||||
@ -287,6 +367,10 @@
|
||||
<component name="VcsContentAnnotationSettings">
|
||||
<option name="myLimit" value="2678400000" />
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="repair some lombok questions" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="repair some lombok questions" />
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/site/cnkj/utils/KafkaUtil.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
@ -342,14 +426,60 @@
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/site/cnkj/utils/service/ActuatorInfo.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="285">
|
||||
<caret line="38" column="32" selection-start-line="38" selection-start-column="32" selection-end-line="38" selection-end-column="32" />
|
||||
<state relative-caret-position="445">
|
||||
<caret line="46" selection-start-line="46" selection-end-line="46" />
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/site/cnkj/utils/StringUtil.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="347">
|
||||
<caret line="107" column="36" selection-start-line="107" selection-start-column="36" selection-end-line="107" selection-end-column="36" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/site/cnkj/utils/domain/DataResult.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="140">
|
||||
<caret line="8" selection-start-line="8" selection-end-line="8" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/site/cnkj/utils/RedisUtil.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="520">
|
||||
<caret line="32" column="32" lean-forward="true" selection-start-line="32" selection-start-column="32" selection-end-line="32" selection-end-column="32" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/site/cnkj/utils/FileEncryptDecrypt.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="200">
|
||||
<caret line="84" column="37" lean-forward="true" selection-start-line="84" selection-start-column="37" selection-end-line="84" selection-end-column="37" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/site/cnkj/utils/FileUtil.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="268">
|
||||
<caret line="37" column="37" lean-forward="true" selection-start-line="37" selection-start-column="37" selection-end-line="37" selection-end-column="37" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/site/cnkj/utils/HttpCommonUtil.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="428">
|
||||
<caret line="65" column="39" selection-start-line="65" selection-start-column="39" selection-end-line="65" selection-end-column="39" />
|
||||
<folding>
|
||||
<element signature="e#1958#1959#0" expanded="true" />
|
||||
<element signature="e#1994#1995#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</component>
|
||||
<component name="masterDetails">
|
||||
<states>
|
||||
|
@ -8,6 +8,7 @@ import javax.crypto.spec.PSource;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
@ -66,11 +67,24 @@ public class FileEncryptDecrypt {
|
||||
fileOutputStream.write(encrypted);
|
||||
fileOutputStream.flush();
|
||||
}
|
||||
fileOutputStream.close();
|
||||
fileInputStream.close();
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if (fileOutputStream != null){
|
||||
try {
|
||||
fileOutputStream.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
try {
|
||||
if (fileInputStream != null){
|
||||
fileInputStream.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -32,21 +32,15 @@ public class FileUtil {
|
||||
}
|
||||
|
||||
public static Boolean checkFileSize(File file, int num) {
|
||||
Boolean flag = false;
|
||||
try {
|
||||
long size = file.length();
|
||||
long mb = 1048576;
|
||||
long res = size/(mb*num);
|
||||
if (res > 0){
|
||||
flag = true;
|
||||
}else if (res <= 0){
|
||||
flag = false;
|
||||
}
|
||||
return res > 0;
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
return flag;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -102,18 +96,33 @@ public class FileUtil {
|
||||
}
|
||||
|
||||
public static int getFileAllLineNumbers(File file) {
|
||||
FileReader fileReader = null;
|
||||
LineNumberReader lineNumberReader = null;
|
||||
try {
|
||||
if (file.isFile()){
|
||||
FileReader fileReader = new FileReader(file);
|
||||
LineNumberReader lineNumberReader = new LineNumberReader(fileReader);
|
||||
fileReader = new FileReader(file);
|
||||
lineNumberReader = new LineNumberReader(fileReader);
|
||||
lineNumberReader.skip(Long.MAX_VALUE);
|
||||
int totalLineNumber = lineNumberReader.getLineNumber();
|
||||
lineNumberReader.close();
|
||||
fileReader.close();
|
||||
return totalLineNumber +1;
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if (fileReader != null){
|
||||
try {
|
||||
fileReader.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (lineNumberReader != null){
|
||||
try {
|
||||
lineNumberReader.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
@ -33,13 +33,12 @@ public class HttpCommonUtil {
|
||||
ip = request.getRemoteAddr();
|
||||
if(ip.equals("127.0.0.1")){
|
||||
//根据网卡取本机配置的IP
|
||||
InetAddress inet=null;
|
||||
try {
|
||||
inet = InetAddress.getLocalHost();
|
||||
InetAddress net = InetAddress.getLocalHost();
|
||||
ip= net.getHostAddress();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
ip= inet.getHostAddress();
|
||||
}
|
||||
}
|
||||
// 多个代理的情况,第一个IP为客户端真实IP,多个IP按照','分割
|
||||
@ -53,14 +52,14 @@ public class HttpCommonUtil {
|
||||
|
||||
//获取本地ip
|
||||
public static String getLocalIp(){
|
||||
InetAddress address = null;
|
||||
try {
|
||||
address = InetAddress.getLocalHost();
|
||||
InetAddress address = InetAddress.getLocalHost();
|
||||
String ip=address.getHostAddress();
|
||||
return ip;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
String ip=address.getHostAddress().toString();
|
||||
return ip;
|
||||
return null;
|
||||
}
|
||||
|
||||
//获取本地机器名
|
||||
@ -69,14 +68,14 @@ public class HttpCommonUtil {
|
||||
}
|
||||
|
||||
private static String getHostName(){
|
||||
InetAddress address = null;
|
||||
try {
|
||||
address = InetAddress.getLocalHost();
|
||||
InetAddress address = InetAddress.getLocalHost();
|
||||
String hostName=address.getHostName();
|
||||
return hostName;
|
||||
} catch (UnknownHostException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
String hostName=address.getHostName().toString();
|
||||
return hostName;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user