Update the filesystem sample to use retainEntry and restoreEntry.