public LocalDrive(string root, ListConfig list, OperationConfig operation, IPolicy policy, ILogger logger) { this.root = root; this.list = list; this.operation = operation; this.policy = policy; _logger = logger; _epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); }
public LocalDrive(string path, DriveConfig config = null) { _epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); root = Path.GetFullPath(path); var p = new CombinedPolicy(); p.Add(new ForceRootPolicy(root)); if (config != null) { _logger = config.Logger; list = config.List; operation = config.Operation; if (config.Policy != null) { p.Add(config.Policy); } } if (list == null) { list = new ListConfig { } } ; if (operation == null) { operation = new OperationConfig { } } ; policy = p; }
// WithOperationConfig makes a copy of drive with new operation config public LocalDrive WithOperationConfig(OperationConfig config) { return(new LocalDrive(root, list, config, policy, _logger)); }