Example #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="name"></param>
 /// <param name="modified"></param>
 /// <param name="contents">string that contains contents of the file</param>
 /// <param name="uploaded"></param>
 /// <param name="fileType"></param>
 /// <param name="size"></param>
 /// <param name="hash"></param>
 public FileContents(string name, DateTime modified, string contents = null,
                     DateTime?uploaded = null, FileType fileType = FileType.PlainText, long size = 0,
                     string hash       = null)
     : base(name, modified, uploaded, fileType, size, hash)
 {
     this.contents = contents;
     if (this.contents != null)
     {
         this.size = (long)contents.Length;
         this.hash = SafetyActions.ComputeHash(contents);
     }
 }
Example #2
0
 private bool IsIdentityValid()
 {
     return(Size.Equals(contents.Length) &&
            Hash.Equals(SafetyActions.ComputeHash(contents)));
 }