What's New in v1.8
π New Features
Records Info API
- New
getRecordsInfo()method returns all cached records sorted by LRU order - New
getRecordInfo(key)method retrieves record metadata without updating access time - New
RecordInfoclass exposes key, filename, size, and last access timestamp - Perfect for cache monitoring, debugging, and building cache management UIs
List<RecordInfo> records = cache.getRecordsInfo();
// Records at the end will be evicted firstπ Bug Fixes
- Fixed file leak on key overwrite β Previously, replacing a file with a different extension would leave orphaned files on disk
- Fixed
accept()logic β Resolved incorrect boolean operator usage that could silently fail file operations - Added cross-filesystem fallback β
renameTo()failures now gracefully fall back to copy+delete
β¨ Improvements
RecordNotFoundExceptionnow properly extendsExceptioninstead ofThrowable- Added file size validation β files larger than cache size are rejected with clear
IOException - Added parameter validation in
create()with descriptive error messages - Replaced deprecated
Charset.forName()withStandardCharsets.UTF_8 - Fixed potential NPE in
SimpleLoggerconstructor
π± Demo App
Completely rewritten with modern Android stack:
- Kotlin β 100% Kotlin codebase
- Jetpack Compose β Declarative UI with Material 3
- Clean Architecture β Domain, Data, and Presentation layers
- MVVM β ViewModel + StateFlow
- Coroutines β Async operations
- Swipe-to-delete, bottom sheets, dynamic theming
π Documentation
- Added Thread Safety section
- Added Limitations section
- Added Requirements (Min SDK 16, Target SDK 35)
- Added Custom FileManager/Logger examples
- Documented new Records Info API
π§ͺ Testing
- Added comprehensive
DiskLruCacheUnitTest(24 tests) - Added
SimpleFileManagerUnitTest(12 tests) - Test coverage for LRU eviction, file operations, edge cases
π¨βπ» New Contributors
Full Changelog: v1.7...v1.8