improve file observer mechanism to work with multiple files
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2017, 2018 Pivotal, Inc.
|
||||
* Copyright (c) 2017, 2020 Pivotal, Inc.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
@@ -54,8 +54,8 @@ public abstract class AbstractFileToProjectCache<P extends IJavaProject> extends
|
||||
protected void attachListeners(File file, P project) {
|
||||
super.attachListeners(file, project);
|
||||
List<String> globPattern = Arrays.asList(file.toString().replace(File.separator, "/"));
|
||||
subscriptions.add(getFileObserver().onFileChanged(globPattern, (uri) -> performUpdate(project, asyncUpdate, true)));
|
||||
subscriptions.add(getFileObserver().onFileDeleted(globPattern, (uri) -> {
|
||||
subscriptions.add(getFileObserver().onFilesChanged(globPattern, (uris) -> performUpdate(project, asyncUpdate, true)));
|
||||
subscriptions.add(getFileObserver().onFilesDeleted(globPattern, (uris) -> {
|
||||
cache.invalidate(file);
|
||||
notifyProjectDeleted(project);
|
||||
dispose();
|
||||
|
||||
Reference in New Issue
Block a user