void (@NotNull VFileEvent event) { if (LOG.isDebugEnabled()) { LOG.debug("Applying " + event); } final VFileEventTracker eventTracker; if (getVfsLogEx() == null) { eventTracker = null; } else { eventTracker = getVfsLogEx().getApplicationVFileEventsTracker().trackEvent(event); } try { if (event instanceof VFileCreateEvent ce) { executeCreateChild(ce.getParent(), ce.getChildName(), ce.getAttributes(), ce.getSymlinkTarget(), ce.isEmptyDirectory()); } else if (event instanceof VFileDeleteEvent deleteEvent) { executeDelete(deleteEvent); } else if (event instanceof VFileContentChangeEvent contentUpdateEvent) { VirtualFile file = contentUpdateEvent.getFile(); long length = contentUpdateEvent.getNewLength(); long timestamp = contentUpdateEvent.getNewTimestamp(); if (!contentUpdateEvent.isLengthAndTimestampDiffProvided()) { NewVirtualFileSystem fs = getFileSystem(file); FileAttributes attributes = fs.getAttributes(file); length = attributes != null ? attributes.length : DEFAULT_LENGTH; timestamp = attributes != null ? attributes.lastModified : DEFAULT_TIMESTAMP; } executeTouch(file, contentUpdateEvent.isFromRefresh(), contentUpdateEvent.getModificationStamp(), length, timestamp); } else if (event instanceof VFileCopyEvent ce) { executeCreateChild(ce.getNewParent(), ce.getNewChildName(), null, null, ce.getFile().getChildren().length == 0); } else if (event instanceof VFileMoveEvent moveEvent) { executeMove(moveEvent.getFile(), moveEvent.getNewParent()); } else if (event instanceof VFilePropertyChangeEvent propertyChangeEvent) { VirtualFile file = propertyChangeEvent.getFile(); Object newValue = propertyChangeEvent.getNewValue(); switch (propertyChangeEvent.getPropertyName()) { case VirtualFile.PROP_NAME -> executeRename(file, (String)newValue); case VirtualFile.PROP_WRITABLE -> { executeSetWritable(file, ((Boolean)newValue).booleanValue()); if (LOG.isDebugEnabled()) { LOG.debug("File " + file + " writable=" + file.isWritable() + " id=" + getFileId(file)); } } case VirtualFile.PROP_HIDDEN -> executeSetHidden(file, ((Boolean)newValue).booleanValue()); case VirtualFile.PROP_SYMLINK_TARGET -> executeSetTarget(file, (String)newValue); case VirtualFile.PROP_CHILDREN_CASE_SENSITIVITY -> executeChangeCaseSensitivity(file, (FileAttributes.CaseSensitivity)newValue); } } } catch (ProcessCanceledException e) { throw e; } catch (Exception e) { LOG.error(e); } finally { if (eventTracker != null) eventTracker.completeEventTracking(); } }