Notify observers that the file has changed

@param file
the file that changes
350885
protected synchronized void notifyChange(File file)
   {
      
      
      System.out.println("Notify change file="+file.getAbsolutePath());
      
   
      this.notify(FileEvent.createChangedEvent(file));
   }
1075570
public void addListener(FileChangeListener fileChangeListener) {
		Assert.notNull(fileChangeListener, "FileChangeListener must not be null");
		synchronized (this.monitor) {
			checkNotStarted();
			this.listeners.add(fileChangeListener);
		}
	}
876943
public void detectChanges() {
        if (engine.isProdMode()) return;
        // Now check for file modification
        List<TemplateClass> modifieds = new ArrayList<TemplateClass>();
        for (TemplateClass tc : engine.classes().all()) {
            if (tc.refresh()) modifieds.add(tc);
        }
        Set<TemplateClass> modifiedWithDependencies = new HashSet<TemplateClass>();
        modifiedWithDependencies.addAll(modifieds);
        List<ClassDefinition> newDefinitions = new ArrayList<ClassDefinition>();
        boolean dirtySig = false;
        for (TemplateClass tc : modifiedWithDependencies) {
            if (tc.compile() == null) {
                engine.classes().remove(tc);
                currentState = new TemplateClassloaderState();//show others that we have changed..
            } else {
                int sigChecksum = tc.sigChecksum;
                tc.enhance();
                if (sigChecksum != tc.sigChecksum) {
                    dirtySig = true;
                }
                newDefinitions.add(new ClassDefinition(tc.javaClass, tc.enhancedByteCode));
                currentState = new TemplateClassloaderState();//show others that we have changed..
            }
        }
        if (!newDefinitions.isEmpty()) {
            throw new ClassReloadException("Need Reload");
        }
        // Check signature (variable name & annotations aware !)
        if (dirtySig) {
            throw new ClassReloadException("Signature change !");
        }

        // Now check if there is new classCache or removed classCache
        int hash = computePathHash();
        if (hash != this.pathHash) {
            // Remove class for deleted files !!
            for (TemplateClass tc : engine.classes().all()) {
                if (!tc.templateResource.isValid()) {
                    engine.classes().remove(tc);
                    currentState = new TemplateClassloaderState();//show others that we have changed..
                }
            }
            throw new ClassReloadException("Path has changed");
        }
    }
995581
@Override
  public void onFileChange(Path path) {
    String fileExtension = path.getName().substring(path.getName().lastIndexOf('.') + 1);
    if (fileExtension.equalsIgnoreCase(SchedulerUtils.JOB_PROPS_FILE_EXTENSION)) {
      LOG.info("Detected change to common properties file " + path.toString());
      loadNewCommonConfigAndHandleNewJob(path, JobScheduler.Action.RESCHEDULE);
      return;
    }

    if (!jobScheduler.jobConfigFileExtensions.contains(fileExtension)) {
      // Not a job configuration file, ignore.
      return;
    }

    LOG.info("Detected change to job configuration file " + path.toString());
    loadNewJobConfigAndHandleNewJob(path, JobScheduler.Action.RESCHEDULE);
  }
1248019
@Override
    public void onFileCreate(File file) {
        try {
            engine.addTemplate(context.getBundle(0), file.toURI().toURL());
        } catch (MalformedURLException e) {
            LOGGER.error("Cannot compute the url of file {}", file.getAbsolutePath(), e);
        }
    }
451390
function watchFile(files, callback) {
  [].concat(files).forEach((file) => {
    watchr.open(file, (changeType) => {
      if (changeType === 'update') {
        callback(file);
      }
    }, (err) => {
      if (err && err.code !== 'ENOENT') {
        throw err;
      }
    });
  });
}
200795
function(file) {
    for(var i = 0; i < watchList.length; i++) {
        if(watchList[i].file === file) {
            watchers[i].close();
            watchList.splice(i, 1);
            watchers.splice(i, 1);
            return;
        }
    }
    throw new Error(file + " was not being watched previously");
}
1238064
void updateFileMonitor(Collection<String> filesToMonitor) {
        if (monitoredFiles.equals(filesToMonitor)) {
            return;
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Updating FileMonitor with a new set of files to monitor: " + filesToMonitor);
        }

        monitoredFiles = filesToMonitor;

        Hashtable<String, Object> properties = getFileMonitorProperties();
        serviceRegistration.setProperties(properties);
    }
269723
public void addPatternFromFile(String file) throws IOException {

		File f = new File(file);
		addPatternFromReader(new FileReader(f));
	}
1261555
public void onFileChange(File file) {
        mojo.getLog().info(EMPTY_STRING);
        mojo.getLog().info("The watcher has detected a change in " + file.getAbsolutePath());
        mojo.getLog().info(EMPTY_STRING);
        for (Watcher watcher : watchers) {
            if (watcher.accept(file)) {
                cleanupErrorFile(watcher);
                // This flag will be set to false if the processing must be interrupted.
                boolean continueProcessing;
                try {
                    continueProcessing = watcher.fileUpdated(file);
                } catch (WatchingException e) { //NOSONAR
                    mojo.getLog().debug(watcher + " has thrown an exception while handling the " + file.getName() + EMPTY_STRING +
                            " update", e);
                    mojo.getLog().error(String.format(WATCHING_EXCEPTION_MESSAGE, e.getMessage()));
                    createErrorFile(watcher, e);
                    continueProcessing = false;
                }
                if (!continueProcessing) {
                    break;
                }
            }
        }
        mojo.getLog().info(EMPTY_STRING);
        mojo.getLog().info(EMPTY_STRING);
    }
1267770
public void updateFromFile(MultipartFile file) {
        ObjectMapper objectMapper = ValidationObjUtil.getDefaultObjectMapper();

        try {
            String jsonStr = new String(file.getBytes(), "UTF-8");
            List<ValidationData> list = objectMapper.readValue(jsonStr, objectMapper.getTypeFactory().constructCollectionType(List.class, ValidationData.class));
            List<ReqUrl> reqUrls = ValidationReqUrlUtil.getUrlListFromValidationDatas(list);
            reqUrls.forEach(reqUrl -> {
                this.deleteValidationData(reqUrl);
            });
            Map<Long, Long> idsMap = new HashMap<>();
            List<ValidationData> saveList = new ArrayList<>();

            list.forEach(data -> {
                long oldId = data.getId();
                data.setId(null);
                data = this.validationDataRepository.save(data);
                idsMap.put(oldId, data.getId());
                saveList.add(data);
            });

            saveList.forEach(data -> {
                if (data.getParentId() != null) {
                    data.setParentId(idsMap.get(data.getParentId()));
                    this.validationDataRepository.save(data);
                }
            });

        } catch (IOException e) {
            log.info("file io exception : " + e.getMessage());
        }
    }
216632
public final void process(final File file) {
        if (file == null) {
            throw new IllegalArgumentException("Argument 'file' cannot be NULL");
        }
        if (file.isFile()) {
            handler.handleFile(file);
        } else {
            processDir(file);
        }
    }
1147155
@Override
  public void refreshGuiAndShowFile(File file) {
    if(rootNode.getChildCount() > 0) {
      rootNode.removeAllChildren();
      treeModel.reload();
    }
    if(guiMain.getAsmProjectUml().getProjectUml() != null) {
      addTreeNodes(file);
      guiMain.getMenuMain().setVisibleProjectMenu(true);
    }
    else {
      guiMain.getMenuMain().setVisibleProjectMenu(false);
    }
  }
750267
@Override
    public boolean fileCreated(File file) throws WatchingException {
        try {
            createApplicationBundle();
        } catch (Exception e) {
            throw new WatchingException(e.getMessage(), file, e);
        }
        return true;
    }
1082367
@Deprecated
    public void stopWatching(File file) {
        if (file == null) {
            throw new IllegalArgumentException("Null file argument");
        }
        synchronized (mutex) {
            stopWatchingInternal(file.toPath());
        }
    }
843144
public static void deleteFiles(final File file) throws IOException
	{
		final File[] ff = file.listFiles();
		if (ff != null)
		{
			for (final File f : ff)
			{
				DeleteFileExtensions.delete(f);
			}
		}
	}
64896
public void parseFile(File file) throws ParserException, IOException {

        Reader reader = null;

        try {
            reader = new FileReader(file);
            nanoElement.parseFromReader(reader);
        } catch (XMLParseException e) {
            throw new ParserException(e.getMessage());
        } finally {
            if (reader != null) reader.close();
        }
    }