getLocalCacheFiles can return null if the configuration doesn't contain the key related to cache files. In that case, cachePaths.length throws NullPointerException. Maybe you should do a double check like:

if (cachePaths != null && cachePaths.length > 0)