This repository was archived by the owner on Dec 29, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
src/main/java/id.my.alvinq.prokitid.libs Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ package id .my .alvinq .prokitid .libs ;
2+
3+ import android .content .Context ;
4+ import org .levimc .launcher .util .Logger ;
5+
6+ import java .io .File ;
7+
8+ public class CacheLogger {
9+
10+ //private static final String TAG = "CacheLogger";
11+
12+ public static void logAllCacheFiles (Context context ) {
13+ if (context == null ) {
14+ Logger .get ().info (TAG , "Context is null, cannot get cache directory!" );
15+ return ;
16+ }
17+
18+ File cacheDir = context .getCacheDir ();
19+ if (cacheDir != null && cacheDir .exists ()) {
20+ Logger .get ().info (TAG , "Cache directory: " + cacheDir .getAbsolutePath ());
21+
22+ File [] files = cacheDir .listFiles ();
23+ if (files != null && files .length > 0 ) {
24+ for (File file : files ) {
25+ if (file .isDirectory ()) {
26+ Logger .get ().info (TAG , "DIR : " + file .getAbsolutePath ());
27+ } else {
28+ Logger .get ().info (TAG , "FILE: " + file .getAbsolutePath () + " (" + file .length () + " bytes)" );
29+ }
30+ }
31+ } else {
32+ Logger .get ().info (TAG , "Cache directory is empty." );
33+ }
34+ } else {
35+ Logger .get ().info (TAG , "Cache directory does not exist." );
36+ }
37+ }
38+ }
You can’t perform that action at this time.
0 commit comments