use of com.intellij.openapi.vfs.pointers.VirtualFilePointerListener in project intellij-community by JetBrains.
the class MavenProjectsManagerWatcher method addFilePointer.
private void addFilePointer(File... settingsFiles) {
Collection<String> pathsToWatch = new ArrayList<>(settingsFiles.length);
for (File settingsFile : settingsFiles) {
if (settingsFile == null)
continue;
File parentFile = settingsFile.getParentFile();
if (parentFile != null) {
String path = getNormalizedPath(parentFile);
if (path != null) {
pathsToWatch.add(path);
}
}
String path = getNormalizedPath(settingsFile);
if (path != null) {
String url = VfsUtilCore.pathToUrl(path);
mySettingsFilesPointers.add(VirtualFilePointerManager.getInstance().create(url, myChangedDocumentsQueue, new VirtualFilePointerListener() {
}));
}
}
myWatchedRoots.addAll(LocalFileSystem.getInstance().addRootsToWatch(pathsToWatch, false));
}
Aggregations