package main;

import org.apache.commons.io.monitor.FileAlterationMonitor;
import org.apache.commons.io.monitor.FileAlterationObserver;

import java.io.File;
import java.io.IOException;

import controllers.InitialMenuController;
import views.InitialMenuView;
import stats.StatUpdateListener;
import stats.Subject;
import models.Roster;

public class MainDriver {
	
	final static String statFilepath = "resources/users/";
	final static String rosterFilepath = "resources/Rosters/";
	final static File resFolder = new File(statFilepath);
	public static Subject statListener = null;
	
	public static void main(String [] args){
		
		statListener = setupFileMonitor(resFolder, 5000);
		statListener.attach(Roster.getInstance(statListener));
		
		InitialMenuView v = new InitialMenuView();
		InitialMenuController con = new InitialMenuController(v);
	
	}
	
	public static Subject setupFileMonitor(File folder, int pollingMsecs){
		FileAlterationObserver observer = new FileAlterationObserver(folder);
		FileAlterationMonitor monitor = new FileAlterationMonitor(pollingMsecs);
		StatUpdateListener listener = new StatUpdateListener();
		
		observer.addListener(listener);
		monitor.addObserver(observer);
		try {
			monitor.start();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			System.out.println("Unexpected problem with file monitor");
			e.printStackTrace();
		}
		return listener;
	}
}

@@ -178,16 +178,38 @@
 ception;
+%0Aimport java.util.Set;
 %0A%0Aimport
@@ -255,106 +255,251 @@
 ort 
-views.InitialMenuView;%0Aimport stats.StatUpdateListener;%0Aimport stats.Subject;%0Aimport models.Roster
+controllers.LeagueController;%0Aimport views.InitialMenuView;%0Aimport views.SoccerLeagueView;%0Aimport stats.StatUpdateListener;%0Aimport stats.Subject;%0Aimport models.League;%0Aimport models.LeagueFactory;%0Aimport models.Roster;%0Aimport models.SoccerTeam
 ;%0A%0Ap
@@ -1004,18 +1004,16 @@
 ler(v);%0A
-%09%0A
 %09%7D%0A%09%0A%09pu

Update MainDriver