Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dlink
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
zhaowei
dlink
Commits
a1a70c93
Commit
a1a70c93
authored
Apr 20, 2022
by
huzekang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Improve] Auto close File Resource
parent
4f195a76
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
12 deletions
+3
-12
CatalogueController.java
...c/main/java/com/dlink/controller/CatalogueController.java
+3
-12
No files found.
dlink-admin/src/main/java/com/dlink/controller/CatalogueController.java
View file @
a1a70c93
...
...
@@ -85,11 +85,10 @@ public class CatalogueController {
private
String
getFileText
(
File
sourceFile
)
{
StringBuilder
sb
=
new
StringBuilder
();
BufferedReader
br
=
null
;
try
{
try
(
InputStreamReader
isr
=
new
InputStreamReader
(
new
FileInputStream
(
sourceFile
))
;
BufferedReader
br
=
new
BufferedReader
(
isr
);)
{
if
(
sourceFile
.
isFile
()
&&
sourceFile
.
exists
())
{
InputStreamReader
isr
=
new
InputStreamReader
(
new
FileInputStream
(
sourceFile
));
br
=
new
BufferedReader
(
isr
);
String
lineText
=
null
;
while
((
lineText
=
br
.
readLine
())
!=
null
)
{
sb
.
append
(
lineText
).
append
(
"\n"
);
...
...
@@ -97,14 +96,6 @@ public class CatalogueController {
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
if
(
br
!=
null
)
{
try
{
br
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
return
sb
.
toString
();
}
...
...
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