def METHOD_NAME(self, filepath, entry_name):
    entry_hash = sha256sum(filepath)
    if entry_hash in self._index["entries"]:
        raise ResourceCacheError("File already in cache")
    entry_path = "%s/%s" % (self._root, entry_hash)
    if os.path.exists(entry_path):
        os.remove(entry_path)
    shutil.move(filepath, entry_path)
    entry = {"name": entry_name,
             "path": entry_path,
             "last_used": int(time.time()),
             "digest": entry_hash,
             "type": "file"}
    self._index["entries"][entry_hash] = entry
    self._save_index()
    return entry_hash