Example #1
0
        public IBaseMessage Execute(IPipelineContext pipelineContext, IBaseMessage message)
        {
            message.EnsureFileOutboundTransport();
            var location = Path.GetDirectoryName(message.GetProperty(BtsProperties.OutboundTransportLocation));

            if (ImpersonationEnabled)
            {
                if (_logger.IsDebugEnabled)
                {
                    _logger.Debug("Impersonating file adapter's configured user to create directory.");
                }
                Delegate.InvokeAs(
                    message.GetProperty(FileProperties.Username),
                    message.GetProperty(FileProperties.Password),
                    () => CreateDirectory(location));
            }
            else
            {
                CreateDirectory(location);
            }
            return(message);
        }