How about change this ling to be 
"      if (info.isFolder() || info.blockIds.size() <= blockIndex) {"
The reason is that it uses cached info first, however, the remote file may have been changed by other users. Therefore, if it is a folder, may just re-fetch the info again.