Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public abstract class BaseInputLog : IDisposable
- {
- protected System.IO.StreamReader file;
- public BaseInputLog()
- {
- this.LoadFile();
- }
- protected abstract void LoadFile();
- public string ReadLine()
- {
- return this.file.ReadLine();
- }
- public int Peek()
- {
- return this.file.Peek();
- }
- public void Close()
- {
- this.file.Close();
- }
- public void Dispose()
- {
- this.file.Dispose();
- }
- }
- public class InputLogFileSystem : BaseInputLog
- {
- private readonly string filePath;
- public InputLogFileSystem(string path) : base()
- {
- this.filePath = path;
- }
- protected override void LoadFile()
- {
- this.file = new System.IO.StreamReader(this.filePath);
- }
- }
- public class InputLogFTP : BaseInputLog
- {
- private readonly string uri;
- private readonly string user;
- private readonly int port;
- private readonly string password;
- public InputLogFTP(string uri) : base()
- {
- this.uri = uri;
- this.user = string.Empty;
- this.port = 22;
- this.password = string.Empty;
- }
- public InputLogFTP(string uri, int port, string user, string password)
- {
- this.uri = uri;
- this.user = user;
- this.port = port;
- this.password = password;
- }
- protected override void LoadFile()
- {
- string localFilePath = string.Empty;
- //localFilePath = downloaded from ftp
- this.file = new System.IO.StreamReader(localFilePath);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement