@Override
	public void run() {
		while (!stop) {
			// get the oldest updated monitor
			try {
				FolderMonitor monitor = updatedMonitors.take();
				Event event = monitor.poll();
				File file = event.getFile();
				if (file == null)
					continue;// Should only be possible for OVERFLOW events,
								// which are not enqueued.
				if (event.getType() == StandardWatchEventKinds.ENTRY_CREATE) {
					Logger.log(file.getAbsolutePath() + " created.");
					if (wasExpected(file)) {
						// Do nothing: we don't want cycles.
					} else if (file.length() > PiCloudConstants.MAX_FILE_SIZE) {
						Logger.logError("File " + file.getName()
								+ " rejected! It's too large!");
						file.delete();
					} else {
						// TODO: get this file over to the DE1
						Logger.log("Sending " + file.getName()
								+ " for encryption...");
					}
				} else if (event.getType() == StandardWatchEventKinds.ENTRY_DELETE) {
					Logger.log(file.getAbsolutePath() + " deleted.");
					// TODO: Something?
				} else if (event.getType() == StandardWatchEventKinds.ENTRY_MODIFY) {
					Logger.log(file.getAbsolutePath() + " modified.");
				}
			} catch (InterruptedException e) {
			}
		}
	}