public void invalidateAllContents() { foreach (KeyValuePair <string, UserFile> entry in filemap) { UserFile file = entry.Value; file.SetFileContent(new byte[0], file.getFileVersionNumberSynchronized()); } }
//mark for deletion, reset the content, update the user file system size public bool deleteFileSynchronized(string filename) { UserFile file = getFileSynchronized(filename); if (file == null) { throw new FileNotFoundException("File not found :" + filename); } bool delete = file.markForDeletionSynchronized(); //reset the content. this will also increment the version number. Don't do it later long sizeDiff = file.SetFileContentSynchronized(new byte[0], file.getFileVersionNumberSynchronized() + 1); incrementTotalFileSystemSize(sizeDiff); return(delete); }