Exemplo n.º 1
0
        public byte[] GetRootFileData(string name)
        {
            if (History.Count == 0 ||
                !History.ContainsKey(name))
            {
                return(null);
            }
            if (History[name].Count != 1)
            {
                throw new Exception("unhandled exeption");
            }
            FileStorageEntry version = History[name][0];

            return(storage.GetContentRaw(version.Location));
        }
Exemplo n.º 2
0
 public string GetLatestVersion(string key)
 {
     if (History.ContainsKey(key))
     {
         List <FileStorageEntry> versions = History[key];
         FileStorageEntry        actual   = (from v in versions
                                             where !v.IsDir
                                             orderby v.Created descending
                                             select v).First();
         return(storage.GetContent(actual.Location));
     }
     else
     {
         return(null);
     }
 }