예제 #1
0
        public static IValidator Create(FileSourceOption fileSourceOption)
        {
            IValidator result = null;

            switch (fileSourceOption.FileSourceType)
            {
            case FileSourceType.Local:
                result = new LocalFileSourceOptionValidator(fileSourceOption);
                break;

            //case FileSourceType.Ftp:
            //    break;
            default:
                throw new ArgumentOutOfRangeException("Not supported FileSourceType");
            }
            return(result);
        }
예제 #2
0
        /// <summary>
        /// Get stream of specified local file.
        /// </summary>
        /// <param name="fileSourceOption">A local file source option</param>
        /// <returns>Stream</returns>
        public Stream GetFileStream(FileSourceOption fileSourceOption)
        {
            var filePath = fileSourceOption.Options[FileSourceOptionKey.KEY_FILESOURCETYPE_LOCAL_FILEPATH];

            return(File.Open(filePath, FileMode.Open));
        }
 public LocalFileSourceOptionValidator(FileSourceOption fileSourceOption) : base(fileSourceOption)
 {
 }