Exemplo n.º 1
0
        public void PutArtifact(ArtifactInfo info, System.IO.Stream stream)
        {
            var jss = new JsonSerializer<ArtifactObject>();

            long ctr = client.IncrementValue(fileNameCounterKey);

            string fileName = filePrefix + "/" + ctr + ".artifact";

            client.AddItemToList(artifactListKey, jss.Serialize(info));

            using(var fs = File.Create(fileName))
            {
                stream.CopyTo(fs);
            }
        }
        public void PutArtifact(ArtifactInfo info, Stream stream)
        {
            using(var myLock = client.AcquireLock(lockKey))
            {
                long number = client.IncrementValue(artifactCounterKey);

                string infoString = jss.Serialize(info);
                client.SetEntry(MakeArtifactInfoKey(number), infoString);

                string fileName = MakeArtifactFilename(number-1);

                using(var fs = File.OpenWrite(fileName))
                {
                    stream.CopyTo(fs);
                }
            }
        }
Exemplo n.º 3
0
 public ArtifactInfo(ArtifactInfo ai)
 {
     this.Name        = ai.Name;
     this.Description = ai.Description;
     this.FileName    = ai.FileName;
 }
Exemplo n.º 4
0
 public ArtifactInfo(ArtifactInfo ai)
 {
     this.Name = ai.Name;
     this.Description = ai.Description;
     this.FileName = ai.FileName;
 }