From 003f5331fa2659ef53fe24fa8f96963f959b24e3 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 11 Sep 2015 11:17:51 +0200 Subject: [PATCH] revert to previous, proven index.xml writing It was added in c831cf77ccf9ecfa792d0ffdc84f272053fa945a and changed in 42d31eb0e6e5d5c9e7fe9c35435a56258ad90578 --- .../org/fdroid/fdroid/localrepo/LocalRepoManager.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/F-Droid/src/org/fdroid/fdroid/localrepo/LocalRepoManager.java b/F-Droid/src/org/fdroid/fdroid/localrepo/LocalRepoManager.java index ad23254c8..58b64ef9a 100644 --- a/F-Droid/src/org/fdroid/fdroid/localrepo/LocalRepoManager.java +++ b/F-Droid/src/org/fdroid/fdroid/localrepo/LocalRepoManager.java @@ -345,11 +345,13 @@ public class LocalRepoManager { serializer = XmlPullParserFactory.newInstance().newSerializer(); } - public void build(Writer output) throws IOException, LocalRepoKeyStore.InitException { + public void build(File file) throws IOException, LocalRepoKeyStore.InitException { + Writer output = new FileWriter(file); serializer.setOutput(output); serializer.startDocument(null, null); tagFdroid(); serializer.endDocument(); + output.close(); } private void tagFdroid() throws IOException, LocalRepoKeyStore.InitException { @@ -485,16 +487,12 @@ public class LocalRepoManager { public void writeIndexJar() throws IOException { - FileWriter writer = null; try { - writer = new FileWriter(xmlIndex); - new IndexXmlBuilder(context, apps).build(writer); + new IndexXmlBuilder(context, apps).build(xmlIndex); } catch (Exception e) { Log.e(TAG, "Could not write index jar", e); Toast.makeText(context, R.string.failed_to_create_index, Toast.LENGTH_LONG).show(); return; - } finally { - Utils.closeQuietly(writer); } BufferedOutputStream bo = new BufferedOutputStream(new FileOutputStream(xmlIndexJarUnsigned));