@Override
    public BinaryResource commit(Object debugInfo, long time) throws IOException {
      // the temp resource must be ours!
      File targetFile = getContentFileFor(mResourceId);

      try {
        FileUtils.rename(mTemporaryFile, targetFile);
      } catch (FileUtils.RenameException re) {
        CacheErrorLogger.CacheErrorCategory category;
        Throwable cause = re.getCause();
        if (cause == null) {
          category = CacheErrorLogger.CacheErrorCategory.WRITE_RENAME_FILE_OTHER;
        } else if (cause instanceof FileUtils.ParentDirNotFoundException) {
          category =
              CacheErrorLogger.CacheErrorCategory.WRITE_RENAME_FILE_TEMPFILE_PARENT_NOT_FOUND;
        } else if (cause instanceof FileNotFoundException) {
          category = CacheErrorLogger.CacheErrorCategory.WRITE_RENAME_FILE_TEMPFILE_NOT_FOUND;
        } else {
          category = CacheErrorLogger.CacheErrorCategory.WRITE_RENAME_FILE_OTHER;
        }
        mCacheErrorLogger.logError(category, TAG, "commit", re);
        throw re;
      }
      if (targetFile.exists()) {
        targetFile.setLastModified(time);
      }
      return FileBinaryResource.create(targetFile);
    }
Holds information about the different files this storage uses (content, tmp). All file name
parsing should be done through here. Temp files creation is also handled here, to encapsulate
naming.
imagepipeline-base/src/main/java/com/facebook/cache/disk/DefaultDiskStorage.java