GridGgfsFileInfo fileInfo = id2InfoPrj.get(fileId);
GridGgfsFileInfo parentInfo = id2InfoPrj.get(parentId);
if (fileInfo == null || parentInfo == null) {
if (parentInfo != null) { // fileInfo == null
GridGgfsListingEntry entry = parentInfo.listing().get(fileName);
// If file info does not exists but listing entry exists, throw inconsistent exception.
if (entry != null && entry.fileId().equals(fileId))
throw new GridException("Failed to remove file (file system is in inconsistent state) " +
"[fileInfo=" + fileInfo + ", fileName=" + fileName + ", fileId=" + fileId + ']');