JakeWharton / DiskLruCache

Java implementation of a Disk-based LRU cache which specifically targets Android compatibility.
http://jakewharton.github.io/DiskLruCache
Apache License 2.0
5.79k stars 1.18k forks source link

DiskLruCache#STRING_KEY_PATTERN does not allow capital letters in cache keys #73

Closed davivel closed 9 years ago

davivel commented 10 years ago

Is there any reason for this constraint?

Thanks.

JakeWharton commented 10 years ago

Case insensitive file systems like on a Mac. On Sep 19, 2014 4:23 AM, "David A. Velasco" notifications@github.com wrote:

Is there any reason for this constraint?

Thanks.

— Reply to this email directly or view it on GitHub https://github.com/JakeWharton/DiskLruCache/issues/73.

davivel commented 10 years ago

That is not very common in Android devices.

Would you consider to add a method to set the regexp value?

JakeWharton commented 10 years ago

That seems like something that is not a widespread need. Why do you need upper-case in your keys?

On Mon, Sep 22, 2014 at 2:48 AM, David A. Velasco notifications@github.com wrote:

That is not very common in Android devices.

Would you consider to add a method to set the regexp value?

— Reply to this email directly or view it on GitHub https://github.com/JakeWharton/DiskLruCache/issues/73#issuecomment-56334482 .

davivel commented 10 years ago

We are reusing other identifier of the files we want to cache, and may include capital letters. We'd rather not having a separate identifier just for the cache.

necronet commented 9 years ago

Should the DiskLruCache#validateKey method be public to be able to override it?

JakeWharton commented 9 years ago

The class is final.

necronet commented 9 years ago

So I supposed @davivel would have to do a downcase to its keys,

swankjesse commented 9 years ago

Case insensitive file systems are everywhere, including Android. You're better off hashing your file name when creating a cache key.

davivel commented 9 years ago

We already solved it, thanks.