@@ -25,7 +25,7 @@ private CleanUtils() {
2525 * @return {@code true}: success<br>{@code false}: fail
2626 */
2727 public static boolean cleanInternalCache () {
28- return cleanCustomDir (Utils .getApp ().getCacheDir ());
28+ return UtilsBridge . deleteAllInDir (Utils .getApp ().getCacheDir ());
2929 }
3030
3131 /**
@@ -35,7 +35,7 @@ public static boolean cleanInternalCache() {
3535 * @return {@code true}: success<br>{@code false}: fail
3636 */
3737 public static boolean cleanInternalFiles () {
38- return cleanCustomDir (Utils .getApp ().getFilesDir ());
38+ return UtilsBridge . deleteAllInDir (Utils .getApp ().getFilesDir ());
3939 }
4040
4141 /**
@@ -45,7 +45,7 @@ public static boolean cleanInternalFiles() {
4545 * @return {@code true}: success<br>{@code false}: fail
4646 */
4747 public static boolean cleanInternalDbs () {
48- return cleanCustomDir (new File (Utils .getApp ().getFilesDir ().getParent (), "databases" ));
48+ return UtilsBridge . deleteAllInDir (new File (Utils .getApp ().getFilesDir ().getParent (), "databases" ));
4949 }
5050
5151 /**
@@ -66,7 +66,7 @@ public static boolean cleanInternalDbByName(final String dbName) {
6666 * @return {@code true}: success<br>{@code false}: fail
6767 */
6868 public static boolean cleanInternalSp () {
69- return cleanCustomDir (new File (Utils .getApp ().getFilesDir ().getParent (), "shared_prefs" ));
69+ return UtilsBridge . deleteAllInDir (new File (Utils .getApp ().getFilesDir ().getParent (), "shared_prefs" ));
7070 }
7171
7272 /**
@@ -77,7 +77,7 @@ public static boolean cleanInternalSp() {
7777 */
7878 public static boolean cleanExternalCache () {
7979 return Environment .MEDIA_MOUNTED .equals (Environment .getExternalStorageState ())
80- && cleanCustomDir (Utils .getApp ().getExternalCacheDir ());
80+ && UtilsBridge . deleteAllInDir (Utils .getApp ().getExternalCacheDir ());
8181 }
8282
8383 /**
@@ -87,16 +87,6 @@ public static boolean cleanExternalCache() {
8787 * @return {@code true}: success<br>{@code false}: fail
8888 */
8989 public static boolean cleanCustomDir (final String dirPath ) {
90- return cleanCustomDir (UtilsBridge .getFileByPath (dirPath ));
91- }
92-
93- /**
94- * Clean the custom directory.
95- *
96- * @param dir The directory.
97- * @return {@code true}: success<br>{@code false}: fail
98- */
99- public static boolean cleanCustomDir (final File dir ) {
100- return UtilsBridge .deleteFilesInDir (dir );
90+ return UtilsBridge .deleteAllInDir (UtilsBridge .getFileByPath (dirPath ));
10191 }
10292}
0 commit comments