Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
appinventor-sources
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
appinventor-sources
Commits
8ecc6161
Commit
8ecc6161
authored
Jan 04, 2018
by
User
Committed by
Evan W. Patton
Jan 04, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update AARLibrary.java (#1103)
Fix IO not closed properly.
parent
053c7b33
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
appinventor/buildserver/src/com/google/appinventor/buildserver/util/AARLibrary.java
...c/com/google/appinventor/buildserver/util/AARLibrary.java
+9
-7
No files found.
appinventor/buildserver/src/com/google/appinventor/buildserver/util/AARLibrary.java
View file @
8ecc6161
...
@@ -229,8 +229,6 @@ public class AARLibrary {
...
@@ -229,8 +229,6 @@ public class AARLibrary {
*/
*/
public
void
unpackToDirectory
(
final
File
path
)
throws
IOException
{
public
void
unpackToDirectory
(
final
File
path
)
throws
IOException
{
ZipFile
zip
=
null
;
ZipFile
zip
=
null
;
InputStream
input
=
null
;
OutputStream
output
=
null
;
try
{
try
{
zip
=
new
ZipFile
(
aarPath
);
zip
=
new
ZipFile
(
aarPath
);
packageName
=
extractPackageName
(
zip
);
packageName
=
extractPackageName
(
zip
);
...
@@ -238,6 +236,8 @@ public class AARLibrary {
...
@@ -238,6 +236,8 @@ public class AARLibrary {
if
(!
basedir
.
mkdirs
())
{
if
(!
basedir
.
mkdirs
())
{
throw
new
IOException
(
"Unable to create directory for AAR package"
);
throw
new
IOException
(
"Unable to create directory for AAR package"
);
}
}
InputStream
input
=
null
;
OutputStream
output
=
null
;
Enumeration
<?
extends
ZipEntry
>
i
=
zip
.
entries
();
Enumeration
<?
extends
ZipEntry
>
i
=
zip
.
entries
();
while
(
i
.
hasMoreElements
())
{
while
(
i
.
hasMoreElements
())
{
ZipEntry
entry
=
i
.
nextElement
();
ZipEntry
entry
=
i
.
nextElement
();
...
@@ -245,9 +245,13 @@ public class AARLibrary {
...
@@ -245,9 +245,13 @@ public class AARLibrary {
if
(
entry
.
isDirectory
()
&&
!
target
.
exists
()
&&
!
target
.
mkdirs
())
{
if
(
entry
.
isDirectory
()
&&
!
target
.
exists
()
&&
!
target
.
mkdirs
())
{
throw
new
IOException
(
"Unable to create directory "
+
path
.
getAbsolutePath
());
throw
new
IOException
(
"Unable to create directory "
+
path
.
getAbsolutePath
());
}
else
if
(!
entry
.
isDirectory
())
{
}
else
if
(!
entry
.
isDirectory
())
{
output
=
new
FileOutputStream
(
target
);
try
{
input
=
zip
.
getInputStream
(
entry
);
output
=
new
FileOutputStream
(
target
);
IOUtils
.
copy
(
input
,
output
);
input
=
zip
.
getInputStream
(
entry
);
IOUtils
.
copy
(
input
,
output
);
}
finally
{
IOUtils
.
closeQuietly
(
input
,
output
);
}
catalog
(
target
);
catalog
(
target
);
}
}
}
}
...
@@ -256,8 +260,6 @@ public class AARLibrary {
...
@@ -256,8 +260,6 @@ public class AARLibrary {
resdir
=
null
;
resdir
=
null
;
}
}
}
finally
{
}
finally
{
IOUtils
.
closeQuietly
(
output
);
IOUtils
.
closeQuietly
(
input
);
IOUtils
.
closeQuietly
(
zip
);
IOUtils
.
closeQuietly
(
zip
);
}
}
}
}
...
...
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