@Override
	public void run() {
		if (files != null) {
			int i = 0;
			stopScanning = false;
			Set<String> filesInDirectory = getListOfFilesInDirectory(pathToDirectory);
			DirectoryScannedEvent event = null;
			for (Entry<String, String> entry : files.entrySet()) {
				i++;
				if (!stopScanning) {
					event = null;
					entry.getKey();
					entry.getValue();
					if (filesInDirectory.contains((String) entry.getKey()))
						event = new DirectoryScannedEvent(this, false, entry.getValue(), "Status: Scanned " + i + " files of " + files.size());
					else
						event = new DirectoryScannedEvent(this, false, "", "Status: Scanned " + i + " files of " + files.size());
				} else
					break;
				for (DirectoryScannedListener ls : listeners)
					ls.listenForScanner(event);
			}
			event = new DirectoryScannedEvent(this, true, "", "Status: Scanning stoped. Scanned " + i + " files of " + files.size());
			for (DirectoryScannedListener ls : listeners)
				ls.listenForScanner(event);
		}
	}