|
@@ -78,7 +78,6 @@ public class SyncedFolderObserverService extends Service {
|
|
|
|
|
|
file = new File(MainApp.getAppContext().getExternalFilesDir(null).getAbsolutePath() + "/nc_persistence");
|
|
|
|
|
|
- boolean readPerstistanceEntries = false;
|
|
|
|
|
|
if (file.exists() ) {
|
|
|
FileInputStream fis = null;
|
|
@@ -86,7 +85,6 @@ public class SyncedFolderObserverService extends Service {
|
|
|
fis = new FileInputStream(file);
|
|
|
ObjectInputStream ois = new ObjectInputStream(fis);
|
|
|
pairArrayList = (CopyOnWriteArrayList<Pair<SyncedFolder, FileEntry>>)ois.readObject();
|
|
|
- readPerstistanceEntries = true;
|
|
|
} catch (FileNotFoundException e) {
|
|
|
Log_OC.d(TAG, "Failed with FileNotFound while reading persistence file");
|
|
|
} catch (IOException e) {
|
|
@@ -140,7 +138,7 @@ public class SyncedFolderObserverService extends Service {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- writePersistenceEntries(readPerstistanceEntries, file);
|
|
|
+ writePersistenceEntries(file);
|
|
|
|
|
|
try {
|
|
|
monitor.start();
|
|
@@ -152,11 +150,11 @@ public class SyncedFolderObserverService extends Service {
|
|
|
return Service.START_NOT_STICKY;
|
|
|
}
|
|
|
|
|
|
- private void writePersistenceEntries(boolean readPerstistanceEntries, File file) {
|
|
|
+ private void writePersistenceEntries(File file) {
|
|
|
FileOutputStream fos = null;
|
|
|
|
|
|
try {
|
|
|
- if (pairArrayList.size() > 0 && !readPerstistanceEntries) {
|
|
|
+ if (pairArrayList.size() > 0) {
|
|
|
fos = MainApp.getAppContext().openFileOutput(file.getAbsolutePath(), Context.MODE_PRIVATE);
|
|
|
ObjectOutputStream os = new ObjectOutputStream(fos);
|
|
|
for (int i = 0; i < pairArrayList.size(); i++) {
|
|
@@ -201,7 +199,7 @@ public class SyncedFolderObserverService extends Service {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- writePersistenceEntries(false, file);
|
|
|
+ writePersistenceEntries(file);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -264,7 +262,7 @@ public class SyncedFolderObserverService extends Service {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- writePersistenceEntries(false, file);
|
|
|
+ writePersistenceEntries(file);
|
|
|
}
|
|
|
|
|
|
@Override
|