From 04dc0c92ff661d1f840dce1f9953d7ea87ef3043 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Thu, 23 Oct 2014 13:26:48 +0300 Subject: [PATCH] Added workaround for .stfolders not being created (fixes #168). --- .../com/nutomic/syncthingandroid/util/ConfigXml.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/com/nutomic/syncthingandroid/util/ConfigXml.java b/src/main/java/com/nutomic/syncthingandroid/util/ConfigXml.java index 663ef994..e5d1f23c 100644 --- a/src/main/java/com/nutomic/syncthingandroid/util/ConfigXml.java +++ b/src/main/java/com/nutomic/syncthingandroid/util/ConfigXml.java @@ -131,6 +131,16 @@ public class ConfigXml { changed = true; } + // HACK: Create .stfolders in all folders if it does not exist. + // This is not the best place to put it, but it's only temporary. + try { + boolean exists = new File(dir, ".stfolder").createNewFile(); + Log.d(TAG, dir + Boolean.toString(exists)); + } catch (IOException e) { + // This might happen if the device is not mounted. + Log.i(TAG, "Failed to create .stversions in " + dir, e); + } + if (applyLenientMTimes(r)) { changed = true; }