File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -79,21 +79,35 @@ public static void sync(Context context)
79
79
if (fullSyncDir .exists ())
80
80
{
81
81
executeFullSync (context , fullSyncDir );
82
+ deleteRecursive (fullSyncDir );
82
83
return ;
83
84
}
84
85
85
86
File syncDir = new File (syncPath );
86
87
if (syncDir .exists ())
87
88
{
88
- executePartialSync (context , syncDir );
89
+ executePartialSync (context , syncDir );
90
+ deleteRecursive (syncDir );
89
91
}
90
92
91
93
File removedSyncDir = new File (removedSyncPath );
92
94
if (removedSyncDir .exists ())
93
95
{
94
96
executeRemovedSync (context , removedSyncDir );
97
+ deleteRecursive (removedSyncDir );
95
98
}
96
99
}
100
+
101
+ private static void deleteRecursive (File fileOrDirectory ) {
102
+
103
+ if (fileOrDirectory .isDirectory ()){
104
+ for (File child : fileOrDirectory .listFiles ()){
105
+ deleteRecursive (child );
106
+ }
107
+ }
108
+
109
+ fileOrDirectory .delete ();
110
+ }
97
111
98
112
private static boolean getShouldExecuteSync (Context context )
99
113
{
You can’t perform that action at this time.
0 commit comments