Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
common
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
common
Commits
2a4fe134
Commit
2a4fe134
authored
Jun 13, 2019
by
张永
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加个方法
parent
56b6da36
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
FileUtil.java
src/main/java/com/egolm/common/FileUtil.java
+12
-0
No files found.
src/main/java/com/egolm/common/FileUtil.java
View file @
2a4fe134
...
...
@@ -9,6 +9,7 @@ import java.io.File;
import
java.io.FileInputStream
;
import
java.io.FileNotFoundException
;
import
java.io.FileOutputStream
;
import
java.io.FileWriter
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.ObjectInputStream
;
...
...
@@ -594,4 +595,15 @@ public class FileUtil {
}
}
}
public
static
void
appendMethod
(
String
fileName
,
String
content
)
{
try
{
//打开一个写文件器,构造函数中的第二个参数true表示以追加形式写文件
FileWriter
writer
=
new
FileWriter
(
fileName
,
true
);
writer
.
write
(
content
+
"\n"
);
writer
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment