public static ExistsValid ( string root, EventStoreId storeId ) : bool | ||
root | string | |
storeId | EventStoreId | |
Résultat | bool |
public FileEventStoreManager(string rootDirectory) { if (null == rootDirectory) { throw new ArgumentNullException("rootDirectory"); } _rootDirectory = rootDirectory; if (!Directory.Exists(rootDirectory)) { Directory.CreateDirectory(rootDirectory); } var info = new DirectoryInfo(rootDirectory); foreach (var child in info.GetDirectories()) { if (EventStoreId.IsValid(child.Name) != EventStoreId.Rule.Valid) { Log.Info("Skipping invalid folder {0} (invalid name)", child.Name); continue; } var container = EventStoreId.Parse(child.Name); if (FileEventStore.ExistsValid(rootDirectory, container)) { var writer = FileEventStore.OpenExistingForWriting(rootDirectory, container); _stores.Add(container.Name, writer); } else { Log.Info("Skipping invalid folder {0} (can't open)", child.Name); } } }