예제 #1
0
 /// <summary>
 /// Runs the raw file processor on the specified files
 /// </summary>
 /// <param name="name">A name for the processor used for logging</param>
 /// <param name="sources">The raw files to be processed</param>
 /// <param name="streamProvider">Instance capable of reading the sources into a stream</param>
 /// <param name="streamParser">Instance capable of parsing the provided stream</param>
 /// <param name="processors">The data processors to process the parsed data</param>
 /// <returns>True if the operation completed without error, otherwise false</returns>
 public static bool Run(string name, IEnumerable<string> sources, IStreamProvider streamProvider, IStreamParser streamParser, params IDataProcessor[] processors)
 {
     using (var processor = new RawFileProcessor(streamProvider, streamParser, processors) { Name = name })
     {
         foreach (var zip in sources)
         {
             try
             {
                 processor.Process(zip);
             }
             catch (Exception err)
             {
                 Log.Error(err);
                 return false;
             }
         }
     }
     return true;
 }
 /// <summary>
 /// Runs the raw file processor on the specified files
 /// </summary>
 /// <param name="name">A name for the processor used for logging</param>
 /// <param name="sources">The raw files to be processed</param>
 /// <param name="streamProvider">Instance capable of reading the sources into a stream</param>
 /// <param name="streamParser">Instance capable of parsing the provided stream</param>
 /// <param name="processors">The data processors to process the parsed data</param>
 /// <returns>True if the operation completed without error, otherwise false</returns>
 public static bool Run(string name, IEnumerable <string> sources, IStreamProvider streamProvider, IStreamParser streamParser, params IDataProcessor[] processors)
 {
     using (var processor = new RawFileProcessor(streamProvider, streamParser, processors)
     {
         Name = name
     })
     {
         foreach (var zip in sources)
         {
             try
             {
                 processor.Process(zip);
             }
             catch (Exception err)
             {
                 Log.Error(err);
                 return(false);
             }
         }
     }
     return(true);
 }