Clone
Marc Philipp
committed
on 18 May 18
Handle missing cache.properties
Prior to this commit, the check whether initialization is required
threw a `FileNotFoundException` when cach… Show more
Handle missing cache.properties

Prior to this commit, the check whether initialization is required

threw a `FileNotFoundException` when cache.properties did not exist.

Since the file is only created when `DefaultPersistentDirectoryCache`

is used instead of `DefaultPersistentDirectoryStore`, this can happen

when re-using an existing cache directory that used to be accessed

using the latter but from now on will be accessed using the former.

For instance, when adding a cleanup action, `DefaultCacheFactory` will

no longer return a plain store but a Ccache.

The missing properties file will now be ignored when the cache is not

using any properties. Otherwise, it will cause the cache to be

re-initialized, i.e. all contained files will be deleted.

In addition, this commit fixes a `NullPointerException` that occurred

when a property was present in the cache's new properties but missing

in the existing cache.properties file.

Show less

green-master + 456 more