code: public void requestState(long fileId, final FileCallback callback) {
          if (LOG) {
              Log.d(TAG, "Requesting state file #" + fileId);
          }
  
          Downloaded downloaded1 = downloaded.getValue(fileId);
          if (downloaded1 != null) {
              FileSystemReference reference = Storage.fileFromDescriptor(downloaded1.getDescriptor());
              boolean isExist = reference.isExist();
              int fileSize = reference.getSize();
              if (isExist && fileSize == downloaded1.getFileSize()) {
                  if (LOG) {
                      Log.d(TAG, "- Downloaded");
                  }
                  final FileSystemReference fileSystemReference = Storage.fileFromDescriptor(downloaded1.getDescriptor());
                  im.actor.runtime.Runtime.dispatch(() -> callback.onDownloaded(fileSystemReference));
                  return;
              } else {
                  if (LOG) {
                      Log.d(TAG, "- File is corrupted");
                      if (!isExist) {
                          Log.d(TAG, "- File not found");
                      }
                      if (fileSize != downloaded1.getFileSize()) {
                          Log.d(TAG, "- Incorrect file size. Expected: " + downloaded1.getFileSize() + ", got: " + fileSize);
                      }
                  }
                  downloaded.removeItem(downloaded1.getFileId());
              }
          }
  
          final QueueItem queueItem = findItem(fileId);
          if (queueItem == null) {
              im.actor.runtime.Runtime.dispatch(() -> callback.onNotDownloaded());
          } else {
              if (queueItem.isStarted) {
                  final float progress = queueItem.progress;
                  im.actor.runtime.Runtime.dispatch(() -> callback.onDownloading(progress));
  
              } else if (queueItem.isStopped) {
                  im.actor.runtime.Runtime.dispatch(() -> callback.onNotDownloaded());
              } else {
                  im.actor.runtime.Runtime.dispatch(() -> callback.onDownloading(0));
              }
          }
      }
docs: Tasks