Ejemplo n.º 1
0
        public async Task ReadIndex()
        {
            using (var mem = new MemoryStream())
            {
                await this.blob.DownloadToStreamAsync(mem);

                this.Hashes.Clear();
                this.OrderedIndex.Clear();

                mem.Position = 0;
                var reader = new StreamReader(mem);

                while (!reader.EndOfStream)
                {
                    var line  = reader.ReadLine().Split('\t');
                    var index = new BlobIndex()
                    {
                        Name = line[0], Version = int.Parse(line[1]), Hash = line[2], Path = line[2]
                    };

                    if (!Aggregates.ContainsKey(index.Name))
                    {
                        Aggregates[index.Name] = new List <BlobIndex>();
                    }

                    Hashes[index.Hash] = index;
                    Aggregates[index.Name].Add(index);
                    OrderedIndex.Add(index);
                }
            }
        }
Ejemplo n.º 2
0
        public async Task ReadIndex()
        {
            using (var mem = new MemoryStream())
            {
                await this.blob.DownloadToStreamAsync(mem);

                if (gotlease)
                {
                    this.existingdata = mem.ToArray();
                }

                this.Hashes.Clear();
                this.OrderedIndex.Clear();

                mem.Position = 0;
                var reader = new StreamReader(mem);

                while (!reader.EndOfStream)
                {
                    var line  = reader.ReadLine().Split('\t');
                    var index = new BlobIndex()
                    {
                        Name = line[0], Version = int.Parse(line[1]), Hash = line[2], Path = line[2]
                    };

                    Hashes[index.Hash] = index;
                    OrderedIndex.Add(index);
                }
            }
        }
Ejemplo n.º 3
0
        public async Task ReadIndex()
        {
                        
            using (var mem = new MemoryStream())
            {
                await this.blob.DownloadToStreamAsync(mem);

                if (gotlease)
                {
                    this.existingdata = mem.ToArray();
                }

                this.Hashes.Clear();
                this.OrderedIndex.Clear();

                mem.Position = 0;
                var reader = new StreamReader(mem);

                while(!reader.EndOfStream)
                {
                    var line = reader.ReadLine().Split('\t');
                    var index = new BlobIndex() { Name = line[0], Version = int.Parse(line[1]), Hash = line[2], Path = line[2] };

                    Hashes[index.Hash] = index;
                    OrderedIndex.Add(index);
                }
            }
        }