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
4bbd40ac
Unverified
Commit
4bbd40ac
authored
Apr 20, 2022
by
aiwenmo
Committed by
GitHub
Apr 20, 2022
Browse files
Options
Browse Files
Download
Plain Diff
[Improve] Auto close File Resource
[Improve] Auto close File Resource
parents
4f195a76
a1a70c93
Changes
1
Hide 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 @
4bbd40ac
...
...
@@ -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