@Override
public synchronized void registerResourceChangeListener(ResourceChangeListener listener) {
listeners.add(listener);
if (fileSystemWatcher == null) {
fileSystemWatcher = Xnio.getInstance().createFileSystemWatcher("Watcher for " + base, OptionMap.EMPTY);
fileSystemWatcher.watchPath(new File(base), new FileChangeCallback() {
@Override
public void handleChanges(Collection<FileChangeEvent> changes) {
synchronized (FileResourceManager.this) {
final List<ResourceChangeEvent> events = new ArrayList<ResourceChangeEvent>();
for (FileChangeEvent change : changes) {