Skip to content

Commit adfed02

Browse files
author
vhemery
authored
#115 : Introduce file watching concept (#138)
Fix for detecting model removal on parent folder deletion...
1 parent 9e9c8a5 commit adfed02

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • bundles/org.eclipse.emfcloud.modelserver.emf/src/org/eclipse/emfcloud/modelserver/emf/common/watchers

bundles/org.eclipse.emfcloud.modelserver.emf/src/org/eclipse/emfcloud/modelserver/emf/common/watchers/FileModelWatcher.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@ private void handleEvent(final WatchEvent<?> event) {
159159
&& ((Path) ctx).getFileName().toString().equals(fileToWatch.getName());
160160
if (changeOnWatchedFile) {
161161
if (StandardWatchEventKinds.ENTRY_DELETE.equals(event.kind())
162-
|| fileToWatch.lastModified() > resource.getTimeStamp()) {
162+
|| fileToWatch.lastModified() > resource.getTimeStamp()
163+
// when parent folder is trashed, we may receive only a modify event...
164+
|| !fileToWatch.exists()) {
163165
// reconcile model on file change
164166
reconcile(this.resource);
165167
}

0 commit comments

Comments
 (0)