class RxFiles {

  @Nonnull
  public Single<Boolean> isFile(@Nonnull final File file) {
    checkNotNull(file, "\'file\' cannot be null.");
    
    return exists(file).flatMap(exists -> exists ?
        Single.just(file.isFile()) :
        Single.error(new IOException(format("File \'%1$s\' does not exist.", file))));
  }

}