code: public void notifyOfTheResourceChangeEventIfNecessary() {
          final String currentResourceSha1 = this.resourceSha1Hex;
          String newResourceSha1 = null;
          try {
              newResourceSha1 = new Sha1Hash(this.watchedResource.getFile()).toHex();
              if (!newResourceSha1.equals(currentResourceSha1)) {
                  logger.debug("Resource: [{}] | Old Hash: [{}] | New Hash: [{}]", new Object[] {this.watchedResource.getURI(), currentResourceSha1, newResourceSha1});
                  synchronized (this.resourceSha1Hex) {
                      this.resourceSha1Hex = newResourceSha1;
                      this.applicationEventPublisher.publishEvent(new ResourceChangedEvent(this, this.watchedResource.getURI()));
                  }
              }
          }
          catch (final Throwable e) {
              //TODO: Possibly introduce an exception handling strategy?
              logger.error("An exception is caught during 'watchedResource' access", e);
              return;
          }
      }
docs: Compare the SHA1 digests (since last check and the latest) of the configured resource, and if change is detected,
  publish the <code>ResourceChangeEvent</code> to ApplicationContext.