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)
7979 if (fullSyncDir .exists ())
8080 {
8181 executeFullSync (context , fullSyncDir );
82+ deleteRecursive (fullSyncDir );
8283 return ;
8384 }
8485
8586 File syncDir = new File (syncPath );
8687 if (syncDir .exists ())
8788 {
88- executePartialSync (context , syncDir );
89+ executePartialSync (context , syncDir );
90+ deleteRecursive (syncDir );
8991 }
9092
9193 File removedSyncDir = new File (removedSyncPath );
9294 if (removedSyncDir .exists ())
9395 {
9496 executeRemovedSync (context , removedSyncDir );
97+ deleteRecursive (removedSyncDir );
9598 }
9699 }
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+ }
97111
98112 private static boolean getShouldExecuteSync (Context context )
99113 {
You can’t perform that action at this time.
0 commit comments