Permalink
Browse files

[library] Throw exception if the Disk Location is not write-able.

  • Loading branch information...
1 parent b34e45b commit 0628bbf5784e6218bfaece97fcff717a5fed384c @chrisbanes committed Feb 23, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 library/src/uk/co/senab/bitmapcache/BitmapLruCache.java
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
+
package uk.co.senab.bitmapcache;
import com.jakewharton.DiskLruCache;
@@ -683,12 +684,13 @@ private boolean isValidOptionsForDiskCache() {
Log.i(Constants.LOG_TAG,
"Disk Cache has been enabled, but no location given. Please call setDiskCacheLocation(...)");
return false;
+ } else if (!mDiskCacheLocation.canWrite()) {
+ throw new IllegalArgumentException("Disk Cache Location is not write-able");
}
return true;
}
return false;
-
}
private boolean isValidOptionsForMemoryCache() {

0 comments on commit 0628bbf

Please sign in to comment.