code: private static Observable<File> createFileFromUri(final Context context, final Uri data,
        final MimeMap mimeTypeMap) {
      return Observable.defer(new Func0<Observable<File>>() {
        @Override
        public Observable<File> call() {
          try {
            return Observable.just(fileFromUri(context, data, mimeTypeMap));
          } catch (Exception e) {
            logError(e);
            return Observable.error(e);
          }
        }
      });
    }
docs: /*
  Create a copy of the file found under the provided Uri, in the Library's cache folder.
  
  You can supply mime type mapping parameter to choose which map will be used.
  
  MIME_TYPE_MAP - The mime type of the resource will be determined by MimeTypeMap.getMimeTypeFromExtension() method.
  URL_CONNECTION_MAP - The mime type of the resource will be determined by URLConnection.guessContentTypeFromName() method.