Beispiel #1
0
        public async Task <TraceFile> GetTraceFileAsync(string headerFileName)
        {
            var path = Path.Combine(_configuration.TraceFileDirectory, headerFileName);

            var result = new TraceFile
            {
                Headers = await _traceFileReader.ReadHeaderFileAsync(path),
            };

            if (result.IsContentAvailable)
            {
                // TODO: Please refactor me :(
                var contentPath = path.Replace(OnPremiseConnectorHeaderExtension, OnPremiseConnectorContentExtension);

                if (contentPath.Equals(path))
                {
                    contentPath = path.Replace(OnPremiseTargetHeaderExtension, OnPremiseTargetContentExtension);
                }

                result.Content = await _traceFileReader.ReadContentFileAsync(contentPath);
            }

            return(result);
        }
Beispiel #2
0
        public async Task <TraceFile> GetTraceFileAsync(string headerFileName)
        {
            var path = Path.Combine(_configuration.TraceFileDirectory, headerFileName);

            var result = new TraceFile()
            {
                Headers = await _traceFileReader.ReadHeaderFileAsync(path).ConfigureAwait(false),
            };

            if (result.IsContentAvailable)
            {
                // TODO: Please refactor me :(
                var contentPath = path.Replace(_ON_PREMISE_CONNECTOR_HEADER_EXTENSION, _ON_PREMISE_CONNECTOR_CONTENT_EXTENSION);

                if (contentPath.Equals(path))
                {
                    contentPath = path.Replace(_ON_PREMISE_TARGET_HEADER_EXTENSION, _ON_PREMISE_TARGET_CONTENT_EXTENSION);
                }

                result.Content = await _traceFileReader.ReadContentFileAsync(contentPath).ConfigureAwait(false);
            }

            return(result);
        }