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); } }
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); } }
public void Import(IFileSystem fs, Attachment attachment) { Assert.IsTrue((bool) attachment.EnclosingItem["wasRead"]); }
public void Report(Attachment a) { attachments.Add(a); }