Ohh, Java does scoped resources.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4413 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
f1b55ddd64
commit
59b2ffaf95
@ -63,7 +63,7 @@ public class MainActivity extends Activity {
|
||||
while ((entry = zip.getNextEntry()) != null) {
|
||||
if (entry.getName().equals(lookup)) {
|
||||
Log.w("tildefriends", "Extracting " + entry.getName());
|
||||
FileOutputStream out = new FileOutputStream(getFilesDir().toString().concat("/tildefriends"));
|
||||
try (FileOutputStream out = new FileOutputStream(getFilesDir().toString().concat("/tildefriends"))) {
|
||||
byte[] buffer = new byte[32768];
|
||||
int count;
|
||||
while ((count = zip.read(buffer)) != -1) {
|
||||
@ -71,6 +71,8 @@ public class MainActivity extends Activity {
|
||||
}
|
||||
out.close();
|
||||
new File(getFilesDir().toString() + "/tildefriends").setExecutable(true);
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
zip.closeEntry();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user