SuspectedFileSizeException, BlockInfoException, IOException {
File srcFile = new File(CommonUtils.concat(getUserLocalTempFolder(userId), blockId));
File dstFile = new File(CommonUtils.concat(mLocalDataFolder, blockId));
long fileSizeBytes = srcFile.length();
if (!srcFile.exists()) {
throw new FileDoesNotExistException("File " + srcFile + " does not exist.");
}
synchronized (mBlockIdToLatestAccessTimeMs) {
if (!srcFile.renameTo(dstFile)) {
throw new FileDoesNotExistException("Failed to rename file from " + srcFile.getPath()
+ " to " + dstFile.getPath());
}
if (mBlockSizes.containsKey(blockId)) {
mSpaceCounter.returnUsedBytes(mBlockSizes.get(blockId));
}