Skip to content

Commit 8634146

Browse files
committed
优化代码
1 parent 767a17b commit 8634146

6 files changed

Lines changed: 14 additions & 13 deletions

File tree

src/main/java/com/xwintop/xJavaFxTool/services/littleTools/FileMergeToolService.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,25 +161,27 @@ public void mergeCsv(List<File> fileList, String newFilePath) throws Exception {
161161

162162
public void mergeFile(List<File> fileList, String newFilePath) throws Exception {
163163
File resultFile = new File(newFilePath);
164-
FileChannel resultFileChannel = null;
164+
FileOutputStream fileOutputStream = null;
165165
try {
166-
resultFileChannel = new FileOutputStream(resultFile, true).getChannel();
166+
fileOutputStream = new FileOutputStream(resultFile, true);
167+
FileChannel resultFileChannel = fileOutputStream.getChannel();
167168
for (File file : fileList) {
168-
FileChannel blk = null;
169+
FileInputStream fileInputStream = null;
169170
try {
170-
blk = new FileInputStream(file).getChannel();
171+
fileInputStream = new FileInputStream(file);
172+
FileChannel blk = fileInputStream.getChannel();
171173
resultFileChannel.transferFrom(blk, resultFileChannel.size(), blk.size());
172174
} finally {
173-
if (blk != null) {
174-
blk.close();
175+
if (fileInputStream != null) {
176+
fileInputStream.close();
175177
}
176178
}
177179
}
178180
} catch (Exception e) {
179181
log.error("合并文件失败:", e);
180182
} finally {
181-
if (resultFileChannel != null) {
182-
resultFileChannel.close();
183+
if (fileOutputStream != null) {
184+
fileOutputStream.close();
183185
}
184186
}
185187
}

src/main/java/com/xwintop/xTransfer/messaging/IMessage.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ public interface IMessage extends Cloneable, Serializable {
5454

5555
void setVersion(String var1);
5656

57-
Object clone() throws CloneNotSupportedException;
58-
5957
void addFileNameFilterRegexGroup(String fileNameFilterRegexGroup);
6058

6159
boolean checkFileNameFilterRegexGroup(String fileNameFilterRegexGroup);

src/main/resources/com/xwintop/xJavaFxTool/web/javaFxTools/ShowSystemInfo/diskInfohCharts.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8">
5-
<!--<meta http-equiv="Access-Control-Allow-Origin" content="*">-->
65
<title>硬盘存储展示</title>
76
<script src="../../libs/highcharts.js"></script>
87
<script src="../../libs/modules/sunburst.js"></script>

src/main/resources/com/xwintop/xJavaFxTool/web/littleTools/cron表达式详解.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<html lang="zh-cn">
44
<head>
55
<meta charset="utf-8" />
6+
<title>cron表达式详解</title>
67
</head>
78
<body>
89
<div id="main">

src/main/resources/com/xwintop/xJavaFxTool/web/littleTools/正则表达式教程.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
55
<meta http-equiv="Content-Language" content="zh-CN"/>
6+
<title>正则表达式教程</title>
67
<style type="text/css">
78
body {
89
font-size: 100%;

src/main/resources/web/littleTools/cron/Cron/cron.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,14 @@ $(function() {
108108

109109
});
110110
//当前选中项之前的如果为*,则都设置成0
111-
for (var i = currentIndex; i >= 1; i--) {
111+
for (let i = currentIndex; i >= 1; i--) {
112112
if (item[i] != "*" && item[i - 1] == "*") {
113113
item[i - 1] = "0";
114114
}
115115
}
116116
//当前选中项之后的如果不为*则都设置成*
117117
if (item[currentIndex] == "*") {
118-
for (var i = currentIndex + 1; i < item.length; i++) {
118+
for (let i = currentIndex + 1; i < item.length; i++) {
119119
if (i == 5) {
120120
item[i] = "?";
121121
} else {

0 commit comments

Comments
 (0)