Example #1
0
        public void Persist(IInboundMetadata inboundMetadata, FileInfo payloadPath)
        {
            var    targetFolder = PersisterUtils.CreateArtifactFolders(this.inboundFolder, inboundMetadata.GetHeader()).FullName;
            var    identifier   = FileUtils.FilterString(inboundMetadata.GetTransmissionIdentifier().Identifier);
            string targetFile   = Path.Combine(targetFolder, $"{identifier}.receipt.dat");

            using (var fs = File.Create(targetFile))
            {
                this.evidenceFactory.Write(fs, inboundMetadata);
            }

            Logger.DebugFormat("Receipt persisted to: {0}", targetFile);
        }
Example #2
0
        public FileInfo Persist(TransmissionIdentifier transmissionIdentifier, Header header, Stream inputStream)
        {
            var    identifier   = FileUtils.FilterString(transmissionIdentifier.Identifier);
            var    targetFolder = PersisterUtils.CreateArtifactFolders(this.inboundFolder, header).FullName;
            string targetFile   = Path.Combine(targetFolder, $"{identifier}.doc.xml");

            var xmlData = inputStream.ToBuffer();

            File.WriteAllBytes(targetFile, xmlData);


            Logger.DebugFormat("Payload persisted to: {0}", targetFile);

            return(new FileInfo(targetFile));
        }