code: private static boolean isValidCacheDirectory(File file) {
          return !((file == null) || (!file.exists() && !file.mkdirs()) || !file.isDirectory() || !file.canRead()
                  || !file.canWrite());
      }
docs: Determines whether a File instance refers to a valid cache directory.
  <p/>
  This method checks that {@code file} refers to a directory to which the current process has read and write
  access. If the directory does not exist, it will be created.
  
  @param file The File instance to examine. This can be null, which will cause the method to return {@code false}.