public override void ParseDirectory() { myDatabase.ConnectToDB(); if (File.Exists(this.Path)) { // This path is a file this.processFile(this.Path); } else if (Directory.Exists(this.Path)) { // This path is a directory this.processDirectory(this.Path); } else { Console.WriteLine("{0} is not a valid file or directory.", this.Path); } myDatabase.CloseConnection(); }