code: private ResourceDatastore createReplacementDatastore(final ComponentBuilder cb, final ResourceDatastore datastore,
              final Resource replacementResource) {
          final String name = datastore.getName();
          if (datastore instanceof CsvDatastore) {
              final CsvConfiguration csvConfiguration = ((CsvDatastore) datastore).getCsvConfiguration();
              return new CsvDatastore(name, replacementResource, csvConfiguration);
          }
          if (datastore instanceof JsonDatastore) {
              return new JsonDatastore(name, replacementResource, ((JsonDatastore) datastore).getSchemaBuilder());
          }
  
          logger.warn("Could not replace datastore '{}' because it is of an unsupported type: ", name,
                  datastore.getClass().getSimpleName());
          return datastore;
      }
docs: Creates a {@link Datastore} replacement to use for configured properties
  
  @param cb
  @param datastore
  @param replacementResource
  @return a replacement datastore, or null if it shouldn't be replaced