public void Import(Attachment a)
 {
     if (a.HasContents)
     {
         string path = MapPath(a.Url);
         if (!Directory.Exists(Path.GetDirectoryName(path)))
             Directory.CreateDirectory(Path.GetDirectoryName(path));
         File.WriteAllBytes(path, a.FileContents);
     }
 }
        public void Import(IFileSystem fs, Attachment a)
        {
            if (a.HasContents)
            {
                string path = a.Url;

                if(!fs.DirectoryExists(Path.GetDirectoryName(path)))
                {
                    fs.CreateDirectory(Path.GetDirectoryName(path));
                }

                var memoryStream = new MemoryStream(a.FileContents);
                fs.WriteFile(path, memoryStream);
            }
        }
Exemplo n.º 3
0
        public void Import(Attachment a)
        {
            if (a.HasContents)
            {
                string path = a.Url;

                var fs = (Context.Current.Resolve<IFileSystem>());
                if(!fs.DirectoryExists(Path.GetDirectoryName(path)))
                {
                    fs.CreateDirectory(Path.GetDirectoryName(path));
                }

                var memoryStream = new MemoryStream(a.FileContents);
                fs.WriteFile(path, memoryStream);
            }
        }
Exemplo n.º 4
0
 public void Import(IFileSystem fs, Attachment attachment)
 {
     Assert.IsTrue((bool) attachment.EnclosingItem["wasRead"]);
 }
Exemplo n.º 5
0
 public void Report(Attachment a)
 {
     attachments.Add(a);
 }
Exemplo n.º 6
0
 public void Report(Attachment a)
 {
     attachments.Add(a);
 }