You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ma...@apache.org on 2022/04/06 15:55:02 UTC

[nifi] branch main updated: NIFI-9615 Extending capabilities of NAR provider with restraining, conflict resolution strategy and refactors to make it more flexible

This is an automated email from the ASF dual-hosted git repository.

markap14 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new 9c71d83c5c NIFI-9615 Extending capabilities of NAR provider with restraining, conflict resolution strategy and refactors to make it more flexible
9c71d83c5c is described below

commit 9c71d83c5c7b46e363529bce94b7ab6fd2807b86
Author: Bence Simon <si...@gmail.com>
AuthorDate: Fri Jan 21 15:35:23 2022 +0100

    NIFI-9615 Extending capabilities of NAR provider with restraining, conflict resolution strategy and refactors to make it more flexible
---
 ...xternalResourceConflictResolutionStrategy.java} |  23 +-
 .../resource/ExternalResourceDescriptor.java}      |  20 +-
 .../resource/ExternalResourceProvider.java}        |  24 +-
 ...rnalResourceProviderInitializationContext.java} |  20 +-
 .../ImmutableExternalResourceDescriptor.java}      |  36 +-
 .../main/java/org/apache/nifi/nar/NarProvider.java |   6 +
 .../nifi/nar/NarProviderInitializationContext.java |   6 +
 nifi-commons/nifi-external-resource-utils/pom.xml  |  32 ++
 .../NarProviderAdapterInitializationContext.java   |  35 +-
 .../java/org/apache/nifi/util/NiFiProperties.java  |   2 +-
 nifi-commons/pom.xml                               |   1 +
 .../src/main/asciidoc/administration-guide.adoc    |  52 ++-
 .../nifi-framework-external-resource-utils/pom.xml |  60 +++
 .../CollisionAwareResourceProviderWorker.java      |  89 +++++
 .../CompositeExternalResourceProviderService.java  |  90 +++++
 ...ictResolvingExternalResourceProviderWorker.java | 162 ++++++++
 .../resource/DoNotReplaceResolutionStrategy.java   |  23 +-
 .../ExternalResourceProviderException.java         |  23 +-
 .../resource/ExternalResourceProviderService.java  |  40 ++
 .../ExternalResourceProviderServiceBuilder.java    | 108 +++++
 .../resource/ExternalResourceProviderWorker.java}  |  25 +-
 .../nifi/flow/resource/NarProviderAdapter.java     |  71 ++++
 ...rnalResourceProviderInitializationContext.java} |  43 +-
 .../ReplaceWithNewerResolutionStrategy.java        |  27 +-
 .../CollisionAwareResourceProviderWorkerTest.java  | 441 +++++++++++++++++++++
 ...mpositeExternalResourceProviderServiceTest.java |  86 ++++
 .../DoNotReplaceResolutionStrategyTest.java        |  49 +++
 ...lResourceProviderInitializationContextTest.java |  95 +++++
 .../ReplaceWithNewerResolutionStrategyTest.java    | 104 +++++
 .../src/test/resources/resource.json               |   0
 .../nifi-framework-components/pom.xml              |  10 +
 .../extension/AbstractExtensionBundleMetadata.java |   9 +-
 .../NiFiRegistryExtensionBundleMetadata.java       |   8 +-
 .../extension/NiFiRegistryExtensionRegistry.java   |   1 +
 ...a => NiFiRegistryExternalResourceProvider.java} |  34 +-
 .../extension/NiFiRegistryNarProvider.java         |  69 +---
 .../extension/ExtensionBundleMetadata.java         |   5 +
 ...che.nifi.flow.resource.ExternalResourceProvider |  15 +
 .../java/org/apache/nifi/nar/NarAutoLoader.java    |  39 +-
 .../java/org/apache/nifi/nar/NarProviderTask.java  | 109 -----
 ...pertyBasedNarProviderInitializationContext.java |   8 +-
 .../nar/StandardExtensionDiscoveringManager.java   |   2 +
 .../apache/nifi/headless/HeadlessNiFiServer.java   |   2 +-
 .../src/main/resources/conf/nifi.properties        |   2 +-
 .../nifi-framework/nifi-web/nifi-jetty/pom.xml     |   5 +
 .../org/apache/nifi/web/server/JettyServer.java    | 109 ++++-
 .../nifi-framework-bundle/nifi-server-nar/pom.xml  |   1 -
 nifi-nar-bundles/nifi-framework-bundle/pom.xml     |   6 +
 .../nifi-hdfs-processors/pom.xml                   |   6 +
 .../hadoop/HDFSExternalResourceProvider.java}      |  71 ++--
 .../apache/nifi/nar/hadoop/HDFSNarProvider.java    | 226 +----------
 ...che.nifi.flow.resource.ExternalResourceProvider |  15 +
 52 files changed, 1893 insertions(+), 652 deletions(-)

diff --git a/nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java b/nifi-api/src/main/java/org/apache/nifi/flow/resource/ExternalResourceConflictResolutionStrategy.java
similarity index 59%
copy from nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java
copy to nifi-api/src/main/java/org/apache/nifi/flow/resource/ExternalResourceConflictResolutionStrategy.java
index e5efdc15a9..85f781d5f2 100644
--- a/nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java
+++ b/nifi-api/src/main/java/org/apache/nifi/flow/resource/ExternalResourceConflictResolutionStrategy.java
@@ -14,24 +14,19 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.nifi.nar;
+package org.apache.nifi.flow.resource;
 
-import javax.net.ssl.SSLContext;
-import java.util.Map;
+import java.io.File;
 
 /**
- * Contains necessary information for extensions of NAR auto loader functionality.
+ * Might be used by provider service in order to decide if an available resource should be acquired from the external provider.
  */
-public interface NarProviderInitializationContext {
-
+public interface ExternalResourceConflictResolutionStrategy {
     /**
-     * @return Returns with the available properties.
+     * @param targetDirectory The target directory.
+     * @param available Descriptor of the available resource.
+     *
+     * @return Returns true if the resource should be fetched from the provider. Returns false otherwise.
      */
-    Map<String, String> getProperties();
-
-    /**
-     * @return Returns an SSLContext created from NiFi's keystore/truststore
-     */
-    SSLContext getNiFiSSLContext();
-
+    boolean shouldBeFetched(File targetDirectory, ExternalResourceDescriptor available);
 }
diff --git a/nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java b/nifi-api/src/main/java/org/apache/nifi/flow/resource/ExternalResourceDescriptor.java
similarity index 66%
copy from nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java
copy to nifi-api/src/main/java/org/apache/nifi/flow/resource/ExternalResourceDescriptor.java
index e5efdc15a9..a65508dade 100644
--- a/nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java
+++ b/nifi-api/src/main/java/org/apache/nifi/flow/resource/ExternalResourceDescriptor.java
@@ -14,24 +14,20 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.nifi.nar;
-
-import javax.net.ssl.SSLContext;
-import java.util.Map;
+package org.apache.nifi.flow.resource;
 
 /**
- * Contains necessary information for extensions of NAR auto loader functionality.
+ * Describes an available resource might be fetched from the external source.
  */
-public interface NarProviderInitializationContext {
+public interface ExternalResourceDescriptor {
 
     /**
-     * @return Returns with the available properties.
+     * @return The location of the resource, where the format depends on the actual provider implementation.
      */
-    Map<String, String> getProperties();
+    String getLocation();
 
     /**
-     * @return Returns an SSLContext created from NiFi's keystore/truststore
+     * @return Returns the modification time of the original resource file using Unix timestamp format.
      */
-    SSLContext getNiFiSSLContext();
-
-}
+    long getLastModified();
+}
\ No newline at end of file
diff --git a/nifi-api/src/main/java/org/apache/nifi/nar/NarProvider.java b/nifi-api/src/main/java/org/apache/nifi/flow/resource/ExternalResourceProvider.java
similarity index 50%
copy from nifi-api/src/main/java/org/apache/nifi/nar/NarProvider.java
copy to nifi-api/src/main/java/org/apache/nifi/flow/resource/ExternalResourceProvider.java
index 63fad957ce..e48348d71b 100644
--- a/nifi-api/src/main/java/org/apache/nifi/nar/NarProvider.java
+++ b/nifi-api/src/main/java/org/apache/nifi/flow/resource/ExternalResourceProvider.java
@@ -14,31 +14,33 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.nifi.nar;
+package org.apache.nifi.flow.resource;
 
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Collection;
 
 /**
- * Represents an external source where the NAR files might be acquired from. Used by the NAR auto loader functionality
- * in order to poll an external source for new NAR files to load.
+ * Represents an external source where the resource files might be acquired from. These external resources might be
+ * various: database drivers, different kind of configurations and so on.
  */
-public interface NarProvider {
+public interface ExternalResourceProvider {
+
     /**
-     * Initializes the NAR Provider based on the given set of properties.
+     * Initializes the External Resource Provider based on the given set of properties.
      */
-    void initialize(NarProviderInitializationContext context);
+    void initialize(ExternalResourceProviderInitializationContext context);
 
     /**
-     * Performs a listing of all NAR's that are available.
+     * Performs a listing of all resources that are available.
      *
-     * @Return The result is a list of locations, where the format depends on the actual implementation.
+     * @Return The result is a list of descriptors for the available resources.
      */
-    Collection<String> listNars() throws IOException;
+    Collection<ExternalResourceDescriptor> listResources() throws IOException;
 
     /**
-     * Fetches the NAR at the given location. The location should be one of the values returned by <code>listNars()</code>.
+     * Fetches the resource determined by the descriptor. This usually happens based on {@code ExternalResourceDescriptor#getLocation}
+     * but implementations might differ.
      */
-    InputStream fetchNarContents(String location) throws IOException;
+    InputStream fetchExternalResource(ExternalResourceDescriptor descriptor) throws IOException;
 }
diff --git a/nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java b/nifi-api/src/main/java/org/apache/nifi/flow/resource/ExternalResourceProviderInitializationContext.java
similarity index 61%
copy from nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java
copy to nifi-api/src/main/java/org/apache/nifi/flow/resource/ExternalResourceProviderInitializationContext.java
index e5efdc15a9..5614eca796 100644
--- a/nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java
+++ b/nifi-api/src/main/java/org/apache/nifi/flow/resource/ExternalResourceProviderInitializationContext.java
@@ -14,15 +14,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.nifi.nar;
+package org.apache.nifi.flow.resource;
 
 import javax.net.ssl.SSLContext;
 import java.util.Map;
+import java.util.function.Predicate;
 
 /**
- * Contains necessary information for extensions of NAR auto loader functionality.
+ * Contains necessary information for extensions of external resource provider functionality.
  */
-public interface NarProviderInitializationContext {
+public interface ExternalResourceProviderInitializationContext {
 
     /**
      * @return Returns with the available properties.
@@ -30,8 +31,15 @@ public interface NarProviderInitializationContext {
     Map<String, String> getProperties();
 
     /**
-     * @return Returns an SSLContext created from NiFi's keystore/truststore
+     * @return A predicate, which might filter out unwanted files from the external source during listing. If no filtering
+     * necessary, then the predicate should return {@code true} for every call.
      */
-    SSLContext getNiFiSSLContext();
+    default Predicate<ExternalResourceDescriptor> getFilter() {
+        return (descriptor) -> true;
+    }
 
-}
+    /**
+     * @return Returns an SSLContext.
+     */
+    SSLContext getSSLContext();
+}
\ No newline at end of file
diff --git a/nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java b/nifi-api/src/main/java/org/apache/nifi/flow/resource/ImmutableExternalResourceDescriptor.java
similarity index 53%
copy from nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java
copy to nifi-api/src/main/java/org/apache/nifi/flow/resource/ImmutableExternalResourceDescriptor.java
index e5efdc15a9..f6d3e1ae51 100644
--- a/nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java
+++ b/nifi-api/src/main/java/org/apache/nifi/flow/resource/ImmutableExternalResourceDescriptor.java
@@ -14,24 +14,30 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.nifi.nar;
+package org.apache.nifi.flow.resource;
 
-import javax.net.ssl.SSLContext;
-import java.util.Map;
+import java.util.Objects;
 
-/**
- * Contains necessary information for extensions of NAR auto loader functionality.
- */
-public interface NarProviderInitializationContext {
+public class ImmutableExternalResourceDescriptor implements ExternalResourceDescriptor {
+    private final String location;
+    private final long modifiedAt;
+
+    public ImmutableExternalResourceDescriptor(final String location, final long modifiedAt) {
+        if (modifiedAt < 0) {
+            throw new IllegalArgumentException("The modification time cannot be negative");
+        }
 
-    /**
-     * @return Returns with the available properties.
-     */
-    Map<String, String> getProperties();
+        this.location = Objects.requireNonNull(location);
+        this.modifiedAt = modifiedAt;
+    }
 
-    /**
-     * @return Returns an SSLContext created from NiFi's keystore/truststore
-     */
-    SSLContext getNiFiSSLContext();
+    @Override
+    public String getLocation() {
+        return location;
+    }
 
+    @Override
+    public long getLastModified() {
+        return modifiedAt;
+    }
 }
diff --git a/nifi-api/src/main/java/org/apache/nifi/nar/NarProvider.java b/nifi-api/src/main/java/org/apache/nifi/nar/NarProvider.java
index 63fad957ce..029fefb28f 100644
--- a/nifi-api/src/main/java/org/apache/nifi/nar/NarProvider.java
+++ b/nifi-api/src/main/java/org/apache/nifi/nar/NarProvider.java
@@ -23,7 +23,13 @@ import java.util.Collection;
 /**
  * Represents an external source where the NAR files might be acquired from. Used by the NAR auto loader functionality
  * in order to poll an external source for new NAR files to load.
+ *
+ * @deprecated {@code org.apache.nifi.flow.resource.ExternalResourceProvider} replaces this interface. External resource as
+ * concept includes NARs from external sources but not limited to them. In order to have greater flexibility, the focus of future
+ * implementations and improvements is suggested to be on the external resource approach. Existing implementations at the point of introducing
+ * external resource concept support both interface families for compatibility reasons.
  */
+@Deprecated
 public interface NarProvider {
     /**
      * Initializes the NAR Provider based on the given set of properties.
diff --git a/nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java b/nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java
index e5efdc15a9..d3941b3622 100644
--- a/nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java
+++ b/nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java
@@ -21,7 +21,13 @@ import java.util.Map;
 
 /**
  * Contains necessary information for extensions of NAR auto loader functionality.
+ *
+ * @deprecated {@code org.apache.nifi.flow.resource.ExternalResourceProviderInitializationContext} replaces this interface. External resource as
+ * concept includes NARs from external sources but not limited to them. In order to have greater flexibility, the focus of future
+ * implementations and improvements is suggested to be on the external resource approach. Existing implementations at the point of introducing
+ * external resource concept support both interface families for compatibility reasons.
  */
+@Deprecated
 public interface NarProviderInitializationContext {
 
     /**
diff --git a/nifi-commons/nifi-external-resource-utils/pom.xml b/nifi-commons/nifi-external-resource-utils/pom.xml
new file mode 100644
index 0000000000..e90ef7cbc2
--- /dev/null
+++ b/nifi-commons/nifi-external-resource-utils/pom.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+      http://www.apache.org/licenses/LICENSE-2.0
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.nifi</groupId>
+        <artifactId>nifi-commons</artifactId>
+        <version>1.17.0-SNAPSHOT</version>
+    </parent>
+    <artifactId>nifi-external-resource-utils</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.nifi</groupId>
+            <artifactId>nifi-api</artifactId>
+            <version>1.17.0-SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java b/nifi-commons/nifi-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/NarProviderAdapterInitializationContext.java
similarity index 50%
copy from nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java
copy to nifi-commons/nifi-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/NarProviderAdapterInitializationContext.java
index e5efdc15a9..31ca63871c 100644
--- a/nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java
+++ b/nifi-commons/nifi-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/NarProviderAdapterInitializationContext.java
@@ -14,24 +14,33 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.nifi.nar;
+package org.apache.nifi.flow.resource;
+
+import org.apache.nifi.nar.NarProviderInitializationContext;
 
 import javax.net.ssl.SSLContext;
 import java.util.Map;
+import java.util.function.Predicate;
 
-/**
- * Contains necessary information for extensions of NAR auto loader functionality.
- */
-public interface NarProviderInitializationContext {
+public class NarProviderAdapterInitializationContext implements ExternalResourceProviderInitializationContext {
+    private final NarProviderInitializationContext payload;
+
+    public NarProviderAdapterInitializationContext(final NarProviderInitializationContext payload) {
+        this.payload = payload;
+    }
 
-    /**
-     * @return Returns with the available properties.
-     */
-    Map<String, String> getProperties();
+    @Override
+    public Map<String, String> getProperties() {
+        return payload.getProperties();
+    }
 
-    /**
-     * @return Returns an SSLContext created from NiFi's keystore/truststore
-     */
-    SSLContext getNiFiSSLContext();
+    @Override
+    public SSLContext getSSLContext() {
+        return payload.getNiFiSSLContext();
+    }
 
+    @Override
+    public Predicate<ExternalResourceDescriptor> getFilter() {
+        return descriptor -> descriptor.getLocation().toLowerCase().endsWith(".nar");
+    }
 }
diff --git a/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java b/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java
index 6533deccf9..78b9ae5af9 100644
--- a/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java
+++ b/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java
@@ -506,11 +506,11 @@ public class NiFiProperties extends ApplicationProperties {
         try {
             return Integer.parseInt(value.trim());
         } catch (final Exception e) {
+            logger.warn("Configured value is invalid, falling back to default value", e);
             return defaultValue;
         }
     }
 
-
     public String getAdministrativeYieldDuration() {
         return getProperty(ADMINISTRATIVE_YIELD_DURATION, DEFAULT_ADMINISTRATIVE_YIELD_DURATION);
     }
diff --git a/nifi-commons/pom.xml b/nifi-commons/pom.xml
index 3b8d0095b9..c2f8c69321 100644
--- a/nifi-commons/pom.xml
+++ b/nifi-commons/pom.xml
@@ -27,6 +27,7 @@
         <module>nifi-bootstrap-utils</module>
         <module>nifi-data-provenance-utils</module>
         <module>nifi-expression-language</module>
+        <module>nifi-external-resource-utils</module>
         <module>nifi-flowfile-packager</module>
         <module>nifi-flow-encryptor</module>
         <module>nifi-hl7-query-language</module>
diff --git a/nifi-docs/src/main/asciidoc/administration-guide.adoc b/nifi-docs/src/main/asciidoc/administration-guide.adoc
index da65d9336d..dda5ef3e84 100644
--- a/nifi-docs/src/main/asciidoc/administration-guide.adoc
+++ b/nifi-docs/src/main/asciidoc/administration-guide.adoc
@@ -4131,7 +4131,16 @@ Custom properties can also be configured in the NiFi UI.  See the <<user-guide.a
 [[nar_provider_properties]]
 === NAR Provider Properties
 
-These properties allow configuring one or more NAR providers. A NAR provider retrieves NARs from an external source and copies them to the directory specified by `nifi.nar.library.autoload.directory`.
+These properties are used for all the configured providers.
+
+|====
+|*Property*|*Description*
+|`nifi.nar.library.poll.interval`|The interval between polls. The default value is `5 min`.
+|`nifi.nar.library.conflict.resolution`|The name of the conflict resolution strategy to use. The default is `IGNORE`.
+|`nifi.nar.library.restrain.startup`|If true, the provider restrains NiFi from startup until the first successful resource fetch.
+|====
+
+The following properties allow configuring one or more NAR providers. A NAR provider retrieves NARs from an external source and copies them to the directory specified by `nifi.nar.library.autoload.directory`.
 
 Each NAR provider property follows the format `nifi.nar.library.provider.<identifier>.<property-name>` and each provider must have at least one property named `implementation`.
 
@@ -4141,7 +4150,7 @@ The HDFS NAR provider retrieves NARs using the Hadoop FileSystem API. This can b
 
 |====
 |*Property*|*Description*
-|`nifi.nar.library.provider.hdfs.implementation`| The fully qualified class name of the implementation class which is `org.apache.nifi.nar.hadoop.HDFSNarProvider`.
+|`nifi.nar.library.provider.hdfs.implementation`| The fully qualified class name of the implementation class which is `org.apache.nifi.flow.resource.hadoop.HDFSExternalResourceProvider`.
 |`nifi.nar.library.provider.hdfs.resources`| The comma separated list of configuration resources, such as `core-site.xml`.
 |`nifi.nar.library.provider.hdfs.storage.location`| The optional storage location, such as `hdfs://hdfs-location`. If not specified, the `defaultFs` from `core-site.xml` will be used.
 |`nifi.nar.library.provider.hdfs.source.directory`| The directory within the storage location where NARs are located.
@@ -4448,24 +4457,41 @@ Ensure that the file has appropriate permissions for the nifi user and group.
 
 Refresh the browser page and the custom processor should now be available when adding a new Processor to your flow.
 
+[[nar-providers]]
 === NAR Providers
 
-NiFi supports fetching NAR files for the autoloading feature from external sources. This can be achieved by using NAR Providers. A NAR Provider serves as a connector between an external data store
-and NiFi.
+NiFi supports fetching NAR files for the autoloading feature from external sources. This can be achieved by using External Resource Providers.
+
+An External Resource Provider serves as a connector between an external data source and NiFi.
 
-When configured, a NAR Provider polls the external source for available NAR files and offers them to the framework. The framework then fetches new NAR files and copies them to
+When configured, an External Resource Provider polls the external source for available NAR files and offers them to the framework. The framework then fetches new NAR files and copies them to
 the `nifi.nar.library.autoload.directory` for autoloading.
 
-NAR Provider can be configured by adding the `nifi.nar.library.provider.<providerName>.implementation` property with value containing the proper implementation class. Some implementations might need
+By default, the polling will happen every 5 minutes. It is possible to change this frequency by specifying the property `nifi.nar.library.poll.interval`.
+
+By default NAR files will be downloaded if no file with the same name exists in the folder defined by `nifi.nar.library.autoload.directory`. By setting the `nifi.nar.library.conflict.resolution` other conflict resolution strategies might be applied. Currently, the following strategies are supported:
+
+|===
+| Name      |  Description
+| IGNORE    |  Will not replace files: if a file exists in the directory with the same name, it will not be downloaded again.
+| REPLACE   |  Will replace a file in the target directory if there is an available file in the source but with newer modification date.
+|===
+
+Until the first External Resource collection succeeds for every provider, the service prevents NiFi from finishing startup. In order to override this behaviour, the `nifi.nar.library.restrain.startup` needs to be declared.
+
+With value `true` the service prevents NiFi from starting up until the execution succeeds, with `false` it does not. The default value is `true` in case of the property is not set.
+
+An External Resource Provider can be configured by adding the `nifi.nar.library.provider.<providerName>.implementation` property with value containing the proper implementation class. Some implementations might need
 further properties. These are defined by the implementation and must be prefixed with `nifi.nar.library.provider.<providerName>.`.
 
-The `<providerName>` is arbitrary and serves to correlate multiple properties together for a single provider. Multiple providers might be set, with different `<providerName>`. Currently NiFi supports HDFS based NAR provider.
+The `<providerName>` is arbitrary and serves to correlate multiple properties together for a single provider. Multiple providers might be set, with different `<providerName>`. Currently NiFi supports HDFS based providers.
 
-==== HDFS NAR Provider
+==== HDFS External Resource Provider
 
-This implementation is capable of downloading NAR files from an HDFS file system.
+This implementation is capable of downloading files from an HDFS file system.
 
-The value of the `nifi.nar.library.provider.<providerName>.implementation` must be `org.apache.nifi.nar.hadoop.HDFSNarProvider`. The following further properties are defined by the provider:
+The value of the `nifi.nar.library.provider.<providerName>.implementation` must be `org.apache.nifi.flow.resource.hadoop.HDFSExternalResourceProvider`.
+The following additional properties are defined by the provider:
 
 [options="header"]
 |===
@@ -4480,14 +4506,16 @@ The value of the `nifi.nar.library.provider.<providerName>.implementation` must
 
 Example configuration:
 
-   nifi.nar.library.provider.hdfs1.implementation=org.apache.nifi.nar.hadoop.HDFSNarProvider
+   nifi.nar.library.provider.hdfs1.implementation=org.apache.nifi.flow.resource.hadoop.HDFSExternalResourceProvider
    nifi.nar.library.provider.hdfs1.resources=/etc/hadoop/core-site.xml
    nifi.nar.library.provider.hdfs1.source.directory=/customNars
 
-   nifi.nar.library.provider.hdfs2.implementation=org.apache.nifi.nar.hadoop.HDFSNarProvider
+   nifi.nar.library.provider.hdfs2.implementation=org.apache.nifi.flow.resource.hadoop.HDFSExternalResourceProvider
    nifi.nar.library.provider.hdfs2.resources=/etc/hadoop/core-site.xml
    nifi.nar.library.provider.hdfs2.source.directory=/other/dir/for/customNars
 
+NOTE: For backward compatibility reasons, `org.apache.nifi.nar.hadoop.HDFSNarProvider` is still an accepted implementation, but it is suggested to use 'org.apache.nifi.flow.resource.hadoop.HDFSExternalResourceProvider' instead. Features introduced with the External Resource Provider might not work with this implementation!
+
 == NiFi diagnostics
 
 It is possible to get diagnostics data from a NiFi node by executing the below command:
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/pom.xml
new file mode 100644
index 0000000000..2a4a80a6cc
--- /dev/null
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/pom.xml
@@ -0,0 +1,60 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <!--
+      Licensed to the Apache Software Foundation (ASF) under one or more
+      contributor license agreements.  See the NOTICE file distributed with
+      this work for additional information regarding copyright ownership.
+      The ASF licenses this file to You under the Apache License, Version 2.0
+      (the "License"); you may not use this file except in compliance with
+      the License.  You may obtain a copy of the License at
+          http://www.apache.org/licenses/LICENSE-2.0
+      Unless required by applicable law or agreed to in writing, software
+      distributed under the License is distributed on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+      See the License for the specific language governing permissions and
+      limitations under the License.
+    -->
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <artifactId>nifi-framework-bundle</artifactId>
+        <groupId>org.apache.nifi</groupId>
+        <version>1.17.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>nifi-framework-external-resource-utils</artifactId>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.nifi</groupId>
+            <artifactId>nifi-nar-utils</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.nifi</groupId>
+            <artifactId>nifi-documentation</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.nifi</groupId>
+            <artifactId>nifi-properties</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.nifi</groupId>
+            <artifactId>nifi-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.nifi</groupId>
+            <artifactId>nifi-security-utils</artifactId>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.rat</groupId>
+                <artifactId>apache-rat-plugin</artifactId>
+                <configuration>
+                    <excludes combine.children="append">
+                        <exclude>src/test/resources/resource.json</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/CollisionAwareResourceProviderWorker.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/CollisionAwareResourceProviderWorker.java
new file mode 100644
index 0000000000..8c3d67f41b
--- /dev/null
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/CollisionAwareResourceProviderWorker.java
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.flow.resource;
+
+import org.apache.nifi.nar.NarCloseable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.util.concurrent.CountDownLatch;
+
+/**
+ * It is important to note that this implementation prevents NiFi from catching up a file under writing. For example trying to load a NAR
+ * file which is not fully acquired for example could lead to issues. In order to avoid this, the worker first creates a temporary
+ * file and it will rename it to the expected name only after it has been successfully written to the disk.
+ */
+final class CollisionAwareResourceProviderWorker extends ConflictResolvingExternalResourceProviderWorker {
+    private static final Logger LOGGER = LoggerFactory.getLogger(CollisionAwareResourceProviderWorker.class);
+
+    CollisionAwareResourceProviderWorker(
+        final String namePrefix,
+        final ClassLoader providerClassLoader,
+        final ExternalResourceProvider provider,
+        final ExternalResourceConflictResolutionStrategy resolutionStrategy,
+        final File targetDirectory,
+        final long pollTimeInMs,
+        final CountDownLatch restrainStartupLatch
+    ) {
+        super(namePrefix, providerClassLoader, provider, resolutionStrategy, targetDirectory, pollTimeInMs, restrainStartupLatch);
+    }
+
+    protected void acquireResource(final ExternalResourceDescriptor availableResource) throws IOException {
+        final long startedAt = System.currentTimeMillis();
+
+        final File targetFile = new File(getTargetDirectory(), availableResource.getLocation());
+        final File tempFile = new File(getTargetDirectory().getPath() + "/.provider_" + getId() + "_buffer.tmp");
+        final File backupFile = new File(getTargetDirectory().getPath() + "/.provider_" + getId() + "_aside.tmp");
+
+        try (
+                final NarCloseable narCloseable = NarCloseable.withComponentNarLoader(getProviderClassLoader());
+                final InputStream inputStream = getProvider().fetchExternalResource(availableResource);
+        ) {
+            if (tempFile.exists() && !tempFile.delete()) {
+                throw new ExternalResourceProviderException("Buffer file '" + tempFile.getName() +"' already exists and cannot be deleted");
+            }
+
+            Files.copy(inputStream, tempFile.toPath());
+        }
+
+        if (targetFile.exists() && !targetFile.renameTo(backupFile)) {
+            throw new ExternalResourceProviderException("Target file '" + targetFile.getName() +"' already exists and cannot be moved aside");
+        }
+
+        if (tempFile.renameTo(targetFile)) {
+            LOGGER.info("Downloaded external resource {} in {} ms", availableResource.getLocation(), (System.currentTimeMillis() - startedAt));
+
+            if (backupFile.exists() && !backupFile.delete()) {
+                LOGGER.error("Could not remove set aside file for {}", targetFile.getName());
+            }
+        } else {
+            LOGGER.error("Could not put downloaded resource {} in place", availableResource.getLocation());
+
+            if (!tempFile.delete()) {
+                LOGGER.error("Could not delete buffer file for {}", targetFile.getName());
+            }
+
+            if (backupFile.exists() && !backupFile.renameTo(targetFile)) {
+                LOGGER.error("After failing to put new file in place, could not revert to the previous file");
+            }
+        }
+    }
+}
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/CompositeExternalResourceProviderService.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/CompositeExternalResourceProviderService.java
new file mode 100644
index 0000000000..a20b4ddceb
--- /dev/null
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/CompositeExternalResourceProviderService.java
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.flow.resource;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+
+/**
+ * This service implementation is capable to manage multiple {@code ExternalResourceProviderWorker}
+ * instances all pointing to a different external source, possibly using even different type of providers.
+ */
+final class CompositeExternalResourceProviderService implements ExternalResourceProviderService {
+    private static final Logger LOGGER = LoggerFactory.getLogger(CompositeExternalResourceProviderService.class);
+
+    private final String name;
+    private final Set<ExternalResourceProviderWorker> workers = new HashSet<>();
+    private final CountDownLatch restrainStartupLatch;
+    private volatile boolean started = false;
+
+    CompositeExternalResourceProviderService(final String name, final Set<ExternalResourceProviderWorker> workers, final CountDownLatch restrainStartupLatch) {
+        this.name = name;
+        this.workers.addAll(workers);
+        this.restrainStartupLatch = restrainStartupLatch;
+    }
+
+    @Override
+    public synchronized void start() {
+        if (started) {
+            return;
+        }
+
+        LOGGER.info("Starting External Resource Provider Service ...");
+
+        for (final ExternalResourceProviderWorker worker : workers) {
+            final Thread workerThread = createThread(worker);
+            workerThread.start();
+        }
+
+        try {
+            if (restrainStartupLatch.getCount() > 0) {
+                LOGGER.info("Restrain startup until all providers execute the first fetch");
+            }
+
+            restrainStartupLatch.await();
+        } catch (final InterruptedException e) {
+            Thread.currentThread().interrupt();
+            throw new ExternalResourceProviderException("Starting External Resource Provider Service is interrupted");
+        }
+
+        LOGGER.info("External Resource Provider Service is started successfully");
+    }
+
+    @Override
+    public synchronized void stop() {
+        started = false;
+
+        if (workers != null) {
+            workers.forEach(ExternalResourceProviderWorker::stop);
+            workers.clear();
+        }
+
+        LOGGER.info("External Resource Provider Service is stopped");
+    }
+
+    private Thread createThread(final ExternalResourceProviderWorker worker) {
+        final Thread thread = new Thread(worker);
+        thread.setName("External Resource Provider Service -  " + name +  " - " + worker.getName());
+        thread.setDaemon(true);
+        thread.setContextClassLoader(worker.getProvider().getClass().getClassLoader());
+        return thread;
+    }
+}
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/ConflictResolvingExternalResourceProviderWorker.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/ConflictResolvingExternalResourceProviderWorker.java
new file mode 100644
index 0000000000..2cf08cb0fd
--- /dev/null
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/ConflictResolvingExternalResourceProviderWorker.java
@@ -0,0 +1,162 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.flow.resource;
+
+import org.apache.nifi.nar.NarCloseable;
+import org.apache.nifi.util.FileUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.UUID;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicLong;
+
+/**
+ * This implementation of the worker uses a strategy in order to decide if an available resources is to download. Using
+ * different strategies result different behaviour. Like for example with {@code DoNotReplaceResolutionStrategy}
+ * the worker will not download a file with the same name until the given file is in the target directory, but in the other hand
+ * {@code ReplaceWithNewerResolutionStrategy} will replace resources if a new version is available in the external source.
+ */
+abstract class ConflictResolvingExternalResourceProviderWorker implements ExternalResourceProviderWorker {
+    private static final Logger LOGGER = LoggerFactory.getLogger(ConflictResolvingExternalResourceProviderWorker.class);
+
+    // A unique id is necessary for temporary files not to collide with temporary files from other instances.
+    private final String id = UUID.randomUUID().toString();
+
+    private final String name;
+    private final ClassLoader providerClassLoader;
+    private final ExternalResourceProvider provider;
+    private final File targetDirectory;
+    private final long pollTimeInMs;
+    private final ExternalResourceConflictResolutionStrategy resolutionStrategy;
+    private final CountDownLatch restrainStartupLatch;
+    private final AtomicLong loopCounter = new AtomicLong(1);
+
+    private volatile boolean stopped = false;
+
+    ConflictResolvingExternalResourceProviderWorker(
+        final String namePrefix,
+        final ClassLoader providerClassLoader,
+        final ExternalResourceProvider provider,
+        final ExternalResourceConflictResolutionStrategy resolutionStrategy,
+        final File targetDirectory,
+        final long pollTimeInMs,
+        final CountDownLatch restrainStartupLatch
+    ) {
+        this.name = namePrefix + " - " + id;
+        this.providerClassLoader = providerClassLoader;
+        this.provider = provider;
+        this.resolutionStrategy = resolutionStrategy;
+        this.targetDirectory = targetDirectory;
+        this.pollTimeInMs = pollTimeInMs;
+        this.restrainStartupLatch = restrainStartupLatch;
+    }
+
+    @Override
+    public void run() {
+        LOGGER.info("External resource provider worker is started");
+
+        while (!stopped) {
+            try {
+                FileUtils.ensureDirectoryExistAndCanReadAndWrite(targetDirectory);
+            } catch (final IOException e) {
+                LOGGER.error("Could not ensure that target directory is accessible", e);
+                stopped = true;
+            }
+
+            if (!stopped) {
+                try {
+                    poll();
+
+                    if (loopCounter.get() == 1) {
+                        restrainStartupLatch.countDown();
+                    }
+                } catch (final Throwable e) {
+                    LOGGER.error("Error during polling for external resources", e);
+                }
+            }
+
+            try {
+                Thread.sleep(pollTimeInMs);
+            } catch (final InterruptedException e) {
+                Thread.currentThread().interrupt();
+                LOGGER.warn("External resource provider worker is interrupted");
+                stopped = true;
+            }
+
+            loopCounter.incrementAndGet();
+        }
+    }
+
+    private void poll() throws IOException {
+        LOGGER.debug("Worker starts polling provider for resources");
+
+        final Collection<ExternalResourceDescriptor> availableResources;
+        try (final NarCloseable narCloseable = NarCloseable.withComponentNarLoader(providerClassLoader)) {
+            availableResources = provider.listResources();
+        }
+
+        for (final ExternalResourceDescriptor availableResource : availableResources) {
+            if (resolutionStrategy.shouldBeFetched(targetDirectory, availableResource)) {
+                acquireResource(availableResource);
+            } else {
+                LOGGER.trace("External resource {} is not to be fetched", availableResource.getLocation());
+            }
+        }
+    }
+
+    @Override
+    public final String getName() {
+        return name;
+    }
+
+    @Override
+    public final ExternalResourceProvider getProvider() {
+        return provider;
+    }
+
+    @Override
+    public final boolean isRunning() {
+        return !stopped;
+    }
+
+    @Override
+    public final void stop() {
+        LOGGER.info("External resource provider worker is stopped");
+        stopped = true;
+    }
+
+    protected final String getId() {
+        return id;
+    }
+
+    protected final File getTargetDirectory() {
+        return targetDirectory;
+    }
+
+    protected final ClassLoader getProviderClassLoader() {
+        return providerClassLoader;
+    }
+
+    /**
+     * This method is responsible to acquire the resource based on the provided descriptor.
+     */
+    protected abstract void acquireResource(final ExternalResourceDescriptor availableResource) throws IOException;
+}
diff --git a/nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/DoNotReplaceResolutionStrategy.java
similarity index 62%
copy from nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java
copy to nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/DoNotReplaceResolutionStrategy.java
index e5efdc15a9..3d09c7d7e9 100644
--- a/nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/DoNotReplaceResolutionStrategy.java
@@ -14,24 +14,17 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.nifi.nar;
+package org.apache.nifi.flow.resource;
 
-import javax.net.ssl.SSLContext;
-import java.util.Map;
+import java.io.File;
 
 /**
- * Contains necessary information for extensions of NAR auto loader functionality.
+ * This strategy will allow fetching a resource if there is no existing resource in the target directory with identical name.
  */
-public interface NarProviderInitializationContext {
-
-    /**
-     * @return Returns with the available properties.
-     */
-    Map<String, String> getProperties();
-
-    /**
-     * @return Returns an SSLContext created from NiFi's keystore/truststore
-     */
-    SSLContext getNiFiSSLContext();
+final class DoNotReplaceResolutionStrategy implements ExternalResourceConflictResolutionStrategy {
 
+    @Override
+    public boolean shouldBeFetched(final File targetDirectory, final ExternalResourceDescriptor available) {
+        return !new File(targetDirectory, available.getLocation()).exists();
+    }
 }
diff --git a/nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/ExternalResourceProviderException.java
similarity index 63%
copy from nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java
copy to nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/ExternalResourceProviderException.java
index e5efdc15a9..f7df2988bf 100644
--- a/nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/ExternalResourceProviderException.java
@@ -14,24 +14,15 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.nifi.nar;
-
-import javax.net.ssl.SSLContext;
-import java.util.Map;
+package org.apache.nifi.flow.resource;
 
 /**
- * Contains necessary information for extensions of NAR auto loader functionality.
+ * Exception represents unexpected behaviour from within the resource provider service.
  */
-public interface NarProviderInitializationContext {
-
-    /**
-     * @return Returns with the available properties.
-     */
-    Map<String, String> getProperties();
-
-    /**
-     * @return Returns an SSLContext created from NiFi's keystore/truststore
-     */
-    SSLContext getNiFiSSLContext();
+public class ExternalResourceProviderException extends RuntimeException {
+    private static final long serialVersionUID = 1L;
 
+    public ExternalResourceProviderException(final String message) {
+        super(message);
+    }
 }
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/ExternalResourceProviderService.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/ExternalResourceProviderService.java
new file mode 100644
index 0000000000..c788aabe6f
--- /dev/null
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/ExternalResourceProviderService.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.flow.resource;
+
+/**
+ * The external resource provider service is an internal NiFi service which is responsible to gather files needed for the
+ * healthy behaviour of the flow. These files are called external resources and might serve various purposes: the given files
+ * might be used database driver, configuration file for processors, etc. The provider service is not responsible for the
+ * proper usage of the external resources, it merely collects them.
+ *
+ * The service might gather these external resources from various external sources using different strategies to fetch them
+ * depending on the setup. This interface serves as a facade in front of the working parts, exposing only the necessary
+ * interactions.
+ */
+public interface ExternalResourceProviderService {
+
+    /**
+     * Instructs the service to start polling for external resources and acquire them if predefined conditions apply.
+     */
+    void start();
+
+    /**
+     * Instructs the service to stop polling. All files already polled remain.
+     */
+    void stop();
+}
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/ExternalResourceProviderServiceBuilder.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/ExternalResourceProviderServiceBuilder.java
new file mode 100644
index 0000000000..64e278b7e0
--- /dev/null
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/ExternalResourceProviderServiceBuilder.java
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.flow.resource;
+
+import org.apache.nifi.nar.ExtensionManager;
+import org.apache.nifi.security.util.TlsException;
+import org.apache.nifi.util.FormatUtils;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Supplier;
+
+public final class ExternalResourceProviderServiceBuilder {
+    private final static Map<String, Supplier<ExternalResourceConflictResolutionStrategy>> STRATEGIES = new HashMap<>();
+
+    static {
+        STRATEGIES.put("REPLACE", ReplaceWithNewerResolutionStrategy::new);
+        STRATEGIES.put("IGNORE", DoNotReplaceResolutionStrategy::new);
+    }
+
+    private final String serviceName;
+    private final ExtensionManager extensionManager;
+
+    private File targetDirectory;
+    private long pollIntervalInMillis;
+    private ExternalResourceConflictResolutionStrategy conflictResolutionStrategy;
+    private Map<String, ExternalResourceProvider> providers;
+    private boolean restrainStartup = true;
+
+    public ExternalResourceProviderServiceBuilder(
+            final String serviceName,
+            final ExtensionManager extensionManager) {
+        this.serviceName = serviceName;
+        this.extensionManager = extensionManager;
+    }
+
+    public ExternalResourceProviderServiceBuilder targetDirectory(final File targetDirectory) {
+        this.targetDirectory = targetDirectory;
+        return this;
+    }
+
+    public ExternalResourceProviderServiceBuilder providers(final Map<String, ExternalResourceProvider> providers) {
+        this.providers = providers;
+        return this;
+    }
+
+    public ExternalResourceProviderServiceBuilder conflictResolutionStrategy(final String conflictResolutionStrategy) {
+        this.conflictResolutionStrategy = getExternalResourceConflictResolutionStrategy(conflictResolutionStrategy);
+        return this;
+    }
+
+    public ExternalResourceProviderServiceBuilder pollInterval(final String pollInterval) {
+        this.pollIntervalInMillis = Math.round(FormatUtils.getPreciseTimeDuration(pollInterval.trim(), TimeUnit.MILLISECONDS));
+        return this;
+    }
+
+    public ExternalResourceProviderServiceBuilder restrainingStartup(final boolean restrainStartup) {
+        this.restrainStartup = restrainStartup;
+        return this;
+    }
+
+    public ExternalResourceProviderService build() throws ClassNotFoundException, InstantiationException, IllegalAccessException, TlsException {
+        if (targetDirectory == null) {
+            throw new IllegalArgumentException("Target directory must be specified");
+        }
+
+        final Set<ExternalResourceProviderWorker> workers = new HashSet<>();
+        final CountDownLatch restrainStartupLatch =  new CountDownLatch(restrainStartup ? providers.size() : 0);
+
+        for(final Map.Entry<String, ExternalResourceProvider> provider : providers.entrySet()) {
+            final ClassLoader instanceClassLoader = extensionManager.getInstanceClassLoader(provider.getKey());
+            final ClassLoader providerClassLoader = instanceClassLoader == null ? provider.getValue().getClass().getClassLoader() : instanceClassLoader;
+            final ExternalResourceProviderWorker providerWorker = new CollisionAwareResourceProviderWorker(
+                    serviceName, providerClassLoader, provider.getValue(), conflictResolutionStrategy, targetDirectory, pollIntervalInMillis, restrainStartupLatch);
+
+            workers.add(providerWorker);
+        }
+
+        return new CompositeExternalResourceProviderService(serviceName, workers, restrainStartupLatch);
+    }
+
+    private static ExternalResourceConflictResolutionStrategy getExternalResourceConflictResolutionStrategy(final String conflictResolutionStrategy) {
+        if (!STRATEGIES.containsKey(conflictResolutionStrategy)) {
+            throw new IllegalArgumentException("Unknown conflict resolution strategy: " + conflictResolutionStrategy);
+        }
+
+        return STRATEGIES.get(conflictResolutionStrategy).get();
+    }
+}
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/registry/extension/ExtensionBundleMetadata.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/ExternalResourceProviderWorker.java
similarity index 57%
copy from nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/registry/extension/ExtensionBundleMetadata.java
copy to nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/ExternalResourceProviderWorker.java
index 856b769a4a..fda963c21c 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/registry/extension/ExtensionBundleMetadata.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/ExternalResourceProviderWorker.java
@@ -14,31 +14,30 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.nifi.registry.extension;
+package org.apache.nifi.flow.resource;
 
 /**
- * The metadata for an extension bundle that exists in an extension registry.
+ * Responsible for polling one external source using {@code org.apache.nifi.flow.resource.ExternalResourceProvider}
  */
-public interface ExtensionBundleMetadata {
+interface ExternalResourceProviderWorker extends Runnable {
 
     /**
-     * @return the identifier of the extension registry that the bundle belongs to
+     * @return Returns the name of the worker.
      */
-    String getRegistryIdentifier();
+    String getName();
 
     /**
-     * @return the group id of the bundle
+     * @return Returns the enveloped provider.
      */
-    String getGroup();
+    ExternalResourceProvider getProvider();
 
     /**
-     * @return the artifact id of the bundle
+     * @return Returns true in case the worker is running.
      */
-    String getArtifact();
+    boolean isRunning();
 
     /**
-     * @return the version of the bundle
+     * Stops the worker. The stop might not happen instantly but the implementation must guarantee the worker stops polling within a reasonable amount of time.
      */
-    String getVersion();
-
-}
\ No newline at end of file
+    void stop();
+}
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/NarProviderAdapter.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/NarProviderAdapter.java
new file mode 100644
index 0000000000..f7b30d0ae9
--- /dev/null
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/NarProviderAdapter.java
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.flow.resource;
+
+import org.apache.nifi.nar.NarProvider;
+import org.apache.nifi.nar.NarProviderInitializationContext;
+
+import javax.net.ssl.SSLContext;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@Deprecated
+public class NarProviderAdapter implements ExternalResourceProvider {
+    private final NarProvider payload;
+
+    public NarProviderAdapter(final NarProvider payload) {
+        this.payload = payload;
+    }
+
+    @Override
+    public void initialize(final ExternalResourceProviderInitializationContext context) {
+        payload.initialize(new NarProviderInitializationContextAdapter(context));
+    }
+
+    @Override
+    public Collection<ExternalResourceDescriptor> listResources() throws IOException {
+        // NarProvider is not capable to return information about modification time, it always returns with actual time.
+        // {@code ExternalResourceConflictResolutionStrategy} must be set accordingly.
+        return payload.listNars().stream().map(f -> new ImmutableExternalResourceDescriptor(f, System.currentTimeMillis())).collect(Collectors.toList());
+    }
+
+    @Override
+    public InputStream fetchExternalResource(final ExternalResourceDescriptor descriptor) throws IOException {
+        return payload.fetchNarContents(descriptor.getLocation());
+    }
+
+    private static class NarProviderInitializationContextAdapter implements NarProviderInitializationContext {
+        private final ExternalResourceProviderInitializationContext payload;
+
+        private NarProviderInitializationContextAdapter(final ExternalResourceProviderInitializationContext payload) {
+            this.payload = payload;
+        }
+
+        @Override
+        public Map<String, String> getProperties() {
+            return payload.getProperties();
+        }
+
+        @Override
+        public SSLContext getNiFiSSLContext() {
+            return payload.getSSLContext();
+        }
+    }
+}
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-loading-utils/src/main/java/org/apache/nifi/nar/PropertyBasedNarProviderInitializationContext.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/PropertyBasedExternalResourceProviderInitializationContext.java
similarity index 71%
copy from nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-loading-utils/src/main/java/org/apache/nifi/nar/PropertyBasedNarProviderInitializationContext.java
copy to nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/PropertyBasedExternalResourceProviderInitializationContext.java
index 4f5edd0b01..fded32784c 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-loading-utils/src/main/java/org/apache/nifi/nar/PropertyBasedNarProviderInitializationContext.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/PropertyBasedExternalResourceProviderInitializationContext.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.nifi.nar;
+package org.apache.nifi.flow.resource;
 
 import org.apache.nifi.security.util.SslContextFactory;
 import org.apache.nifi.security.util.StandardTlsConfiguration;
@@ -28,22 +28,23 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
+import java.util.function.Predicate;
 
-/**
- * A facade at front of {@code NiFiProperties} for auto loader extensions. Also limits the scope of the reachable properties.
- */
-public class PropertyBasedNarProviderInitializationContext implements NarProviderInitializationContext {
+public final class PropertyBasedExternalResourceProviderInitializationContext implements ExternalResourceProviderInitializationContext {
     private static Set<String> GUARDED_PROPERTIES = new HashSet<>(Arrays.asList("implementation"));
-    static final String BASIC_PREFIX = "nifi.nar.library.provider.";
 
     private final Map<String, String> properties;
+    private final Predicate<ExternalResourceDescriptor> filter;
     private final SSLContext sslContext;
-    private final String name;
 
-    public PropertyBasedNarProviderInitializationContext(final NiFiProperties properties, final String name) throws TlsException {
-        this.properties = extractProperties(properties, name);
-        this.sslContext = createSSLContext(properties);
-        this.name = name;
+    public PropertyBasedExternalResourceProviderInitializationContext(
+        final NiFiProperties properties,
+        final String prefix,
+        final Predicate<ExternalResourceDescriptor> filter
+    ) throws TlsException {
+        this.properties = extractProperties(properties, prefix);
+        this.filter = filter;
+        this.sslContext = createNiFiSSLContext(properties);
     }
 
     @Override
@@ -52,12 +53,21 @@ public class PropertyBasedNarProviderInitializationContext implements NarProvide
     }
 
     @Override
-    public SSLContext getNiFiSSLContext() {
+    public Predicate<ExternalResourceDescriptor> getFilter() {
+        return filter;
+    }
+
+    @Override
+    public SSLContext getSSLContext() {
         return sslContext;
     }
 
-    private Map<String, String> extractProperties(final NiFiProperties properties, final String name) {
-        final String prefix = BASIC_PREFIX + name + ".";
+    private SSLContext createNiFiSSLContext(final NiFiProperties properties) throws TlsException {
+        final TlsConfiguration tlsConfiguration = StandardTlsConfiguration.fromNiFiProperties(properties);
+        return SslContextFactory.createSslContext(tlsConfiguration);
+    }
+
+    private Map<String, String> extractProperties(final NiFiProperties properties, final String prefix) {
         final Map<String, String> candidates = properties.getPropertiesWithPrefix(prefix);
         final Map<String, String> result = new HashMap<>();
 
@@ -71,9 +81,4 @@ public class PropertyBasedNarProviderInitializationContext implements NarProvide
 
         return result;
     }
-
-    private SSLContext createSSLContext(final NiFiProperties properties) throws TlsException {
-        final TlsConfiguration tlsConfiguration = StandardTlsConfiguration.fromNiFiProperties(properties);
-        return SslContextFactory.createSslContext(tlsConfiguration);
-    }
 }
diff --git a/nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/ReplaceWithNewerResolutionStrategy.java
similarity index 52%
copy from nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java
copy to nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/ReplaceWithNewerResolutionStrategy.java
index e5efdc15a9..0149a1bd0a 100644
--- a/nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/main/java/org/apache/nifi/flow/resource/ReplaceWithNewerResolutionStrategy.java
@@ -14,24 +14,21 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.nifi.nar;
+package org.apache.nifi.flow.resource;
 
-import javax.net.ssl.SSLContext;
-import java.util.Map;
+import java.io.File;
 
 /**
- * Contains necessary information for extensions of NAR auto loader functionality.
+ * This strategy allows to replace the already acquired external resource if the available is newer, based on the modification time.
+ *
+ * This strategy assumes that the external source maintains the modification time in a proper manner and the local files are
+ * not modified by other parties.
  */
-public interface NarProviderInitializationContext {
-
-    /**
-     * @return Returns with the available properties.
-     */
-    Map<String, String> getProperties();
-
-    /**
-     * @return Returns an SSLContext created from NiFi's keystore/truststore
-     */
-    SSLContext getNiFiSSLContext();
+final class ReplaceWithNewerResolutionStrategy implements ExternalResourceConflictResolutionStrategy {
 
+    @Override
+    public boolean shouldBeFetched(final File targetDirectory, final ExternalResourceDescriptor available) {
+        final File file = new File(targetDirectory, available.getLocation());
+        return !file.exists() || file.lastModified() < available.getLastModified();
+    }
 }
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/test/java/org/apache/nifi/flow/resource/CollisionAwareResourceProviderWorkerTest.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/test/java/org/apache/nifi/flow/resource/CollisionAwareResourceProviderWorkerTest.java
new file mode 100644
index 0000000000..52c54a8050
--- /dev/null
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/test/java/org/apache/nifi/flow/resource/CollisionAwareResourceProviderWorkerTest.java
@@ -0,0 +1,441 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.flow.resource;
+
+import org.apache.nifi.util.FileUtils;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.junit.jupiter.MockitoExtension;
+
+import java.io.BufferedOutputStream;
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Optional;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
+
+
+@ExtendWith(MockitoExtension.class)
+public class CollisionAwareResourceProviderWorkerTest {
+    private static final String PREFIX = "prefix";
+    private static final String RESOURCE_NAME_1 = "config.json";
+    private static final String RESOURCE_NAME_2 = "config.xml";
+    private static final String CONTENT_LOCAL = "lorem";
+    private static final String CONTENT_PROVIDED = "ipsum";
+    private static final String CONTENT_TEMP = "tmp";
+    private static final String TARGET_DIRECTORY_PATH = "target/providerTest";
+    private static final File TARGET_DIRECTORY = new File(TARGET_DIRECTORY_PATH);
+
+    @Mock
+    private ExternalResourceConflictResolutionStrategy conflictResolutionStrategy;
+
+    private Actions actions;
+    private CountDownLatch countDownLatch;
+    private TestExternalResourceProvider provider;
+    private CollisionAwareResourceProviderWorker testSubject;
+
+    @BeforeEach
+    public void setUp() throws IOException {
+        if (TARGET_DIRECTORY.exists()) {
+            FileUtils.deleteFile(TARGET_DIRECTORY, true);
+        }
+    }
+
+    @AfterAll
+    public static void tearDown() throws IOException {
+        if (TARGET_DIRECTORY.exists()) {
+            FileUtils.deleteFile(TARGET_DIRECTORY, true);
+        }
+    }
+
+    @Test
+    public void testHappyPathWhenNoResourcesFound() throws InterruptedException {
+        setActions(Action.LIST, Action.LIST, Action.LIST);
+        setUpProviderWithoutResource();
+        setUpTestSubject();
+
+        runningTestSubject();
+
+        assertOperationsAreFinished();
+        verifyConflictResulotionWasNotNeeded();
+        assertTargetFolderIsEmpty();
+    }
+
+    @Test
+    public void testRunWithPreExistingDirectory() throws InterruptedException, IOException {
+        setActions(Action.LIST);
+        ensureTargetDirectoryExists(true);
+        setUpProviderWithoutResource();
+        setUpTestSubject();
+
+        runningTestSubject();
+
+        assertOperationsAreFinished();
+        assertTargetFolderIsEmpty();
+    }
+
+    @Test
+    public void testRunWithPreExistingDirectoryWhenMissingPrivileges() throws InterruptedException, IOException {
+        setNoAction();
+        ensureTargetDirectoryExists(false);
+        setUpProviderWithoutResource();
+        setUpTestSubject();
+
+        runningTestSubject();
+
+        assertOperationsAreFinished();
+    }
+
+    @Test
+    public void testHappyPathWhenThereAreResources() throws InterruptedException, IOException {
+        setUpConflictResolution(true);
+        setActions(Action.LIST, Action.FETCH, Action.FETCH);
+        final ExternalResourceDescriptor resource1 = getAvailableResource(RESOURCE_NAME_1);
+        final ExternalResourceDescriptor resource2 = getAvailableResource(RESOURCE_NAME_2);
+        setProviderWithResource(resource1, resource2);
+        setUpTestSubject();
+
+        runningTestSubject();
+
+        assertOperationsAreFinished();
+        verifyConflictResulotionWasNeeded(resource1, 1);
+        verifyConflictResulotionWasNeeded(resource2, 1);
+        assertTargetFolderContains(CONTENT_PROVIDED, resource1, resource2);
+    }
+
+    @Test
+    public void testWhenSomeResourcesAreConflicting() throws InterruptedException, IOException {
+        setUpConflictResolution(true);
+        setActions(Action.LIST, Action.FETCH);
+        final ExternalResourceDescriptor resource1 = getAvailableResource(RESOURCE_NAME_1);
+        final ExternalResourceDescriptor resource2 = getAvailableResource(RESOURCE_NAME_2);
+        setProviderWithResource(resource1, resource2);
+        setResourceShouldNotBeFetched(resource1);
+        setUpTestSubject();
+
+        runningTestSubject();
+
+        waitForFileOperationsToFinish();
+        verifyConflictResulotionWasNeeded(resource1, 1);
+        verifyConflictResulotionWasNeeded(resource2, 1);
+        assertTargetFolderContains(CONTENT_PROVIDED, resource2);
+    }
+
+    @Test
+    public void testRetryAfterFailure() throws InterruptedException, IOException {
+        setUpConflictResolution(true);
+        setActions(Action.LIST, Action.FETCH, Action.LIST, Action.FETCH);
+        final ExternalResourceDescriptor resource1 = getAvailableResource(RESOURCE_NAME_1);
+        setUpProviderWithResourceAndFetchSuccessSequence(resource1, false, true);
+        setUpTestSubject();
+
+        runningTestSubject();
+
+        waitForFileOperationsToFinish();
+        verifyConflictResulotionWasNeeded(resource1, 2);
+        assertTargetFolderContains(CONTENT_PROVIDED, resource1);
+    }
+
+    @Test
+    public void testExistingFileIsReplaced() throws InterruptedException, IOException {
+        setUpConflictResolution(true);
+        setActions(Action.LIST, Action.FETCH);
+        ensureTargetDirectoryExists(true);
+        ensureFileExists(RESOURCE_NAME_1, CONTENT_LOCAL,true);
+        final ExternalResourceDescriptor resource = getAvailableResource(RESOURCE_NAME_1);
+        setProviderWithResource(resource);
+        setUpTestSubject();
+
+        runningTestSubject();
+
+        waitForFileOperationsToFinish();
+        assertTargetFolderContains(CONTENT_PROVIDED, resource);
+    }
+
+    @Test
+    @Disabled("This test needs human interaction and should not part of a build")
+    public void testExistingFileCannotBeDeleted() throws InterruptedException, IOException {
+        setActions(Action.LIST, Action.FETCH);
+        ensureTargetDirectoryExists(true);
+        ensureFileExists(RESOURCE_NAME_1, CONTENT_LOCAL, false);
+        final ExternalResourceDescriptor resource = getAvailableResource(RESOURCE_NAME_1);
+        setProviderWithResource(resource);
+        setUpTestSubject();
+
+        runningTestSubject();
+
+        waitForFileOperationsToFinish();
+        assertTargetFolderContains(CONTENT_LOCAL, resource);
+        ensureGivenPathIsAccessible(RESOURCE_NAME_1);
+    }
+
+    @Test
+    @Disabled("This test needs human interaction and should not part of a build")
+    public void testExistingTemporaryFileCannotBeDeleted() throws InterruptedException, IOException {
+        setActions(Action.LIST, Action.FETCH);
+        ensureTargetDirectoryExists(true);
+        final ExternalResourceDescriptor resource = getAvailableResource(RESOURCE_NAME_1);
+        setProviderWithResource(resource);
+        setUpTestSubject();
+        final String tempFileName = setTempFileName();
+        ensureFileExists(tempFileName, CONTENT_TEMP,false);
+
+        runningTestSubject();
+
+        waitForFileOperationsToFinish();
+        verifyConflictResulotionWasNeeded(resource, 1);
+        assertTargetFolderContains(CONTENT_TEMP, tempFileName);
+        ensureGivenPathIsAccessible(tempFileName);
+    }
+
+    private void setNoAction() {
+        setActions();
+    }
+
+    private void setActions(Action... actions) {
+        this.actions = new Actions(actions);
+    }
+
+    private void setUpConflictResolution(final boolean shouldBeFetched) {
+        Mockito.when(conflictResolutionStrategy.shouldBeFetched(Mockito.any(File.class), Mockito.any(ExternalResourceDescriptor.class))).thenReturn(shouldBeFetched);
+    }
+
+    private void ensureTargetDirectoryExists(boolean accessible) throws IOException {
+        FileUtils.ensureDirectoryExistAndCanReadAndWrite(TARGET_DIRECTORY);
+
+        if (!accessible) {
+            TARGET_DIRECTORY.setWritable(false);
+        }
+    }
+
+    private ExternalResourceDescriptor getAvailableResource(String resourceName) {
+        final ExternalResourceDescriptor resource = new ImmutableExternalResourceDescriptor(resourceName, System.currentTimeMillis());
+        return resource;
+    }
+
+    private void setUpTestSubject() {
+        testSubject = new CollisionAwareResourceProviderWorker(PREFIX, this.getClass().getClassLoader(), provider, conflictResolutionStrategy, TARGET_DIRECTORY, 50, new CountDownLatch(0));
+    }
+
+    private void setUpProviderWithResourceAndFetchSuccessSequence(final ExternalResourceDescriptor resource, final Boolean... fetchSuccessSequence) {
+        countDownLatch = new CountDownLatch(actions.numberOfAllActions());
+        provider = new TestExternalResourceProvider(Collections.singletonList(resource), countDownLatch, Arrays.asList(fetchSuccessSequence));
+    }
+
+    private void setProviderWithResource(final ExternalResourceDescriptor... resources) {
+        countDownLatch = new CountDownLatch(actions.numberOfAllActions());
+        provider = new TestExternalResourceProvider(Arrays.asList(resources), countDownLatch);
+    }
+
+    private void setUpProviderWithoutResource() {
+        setProviderWithResource();
+    }
+
+    private void ensureFileExists(final String fileName, final String content, final boolean accessible) throws IOException {
+        final File file = new File(TARGET_DIRECTORY, fileName);
+        file.createNewFile();
+
+        try (
+            final FileOutputStream fileOutputStream = new FileOutputStream(file);
+            final BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(fileOutputStream);
+        ) {
+            bufferedOutputStream.write(content.getBytes(StandardCharsets.UTF_8));
+        }
+
+        if (!accessible) {
+            file.setWritable(false);
+        }
+    }
+
+    private String setTempFileName() {
+        return ".provider_" + testSubject.getName().substring(PREFIX.length() + 3) + ".tmp";
+    }
+
+    private void setResourceShouldNotBeFetched(final ExternalResourceDescriptor resource) {
+        Mockito.when(conflictResolutionStrategy.shouldBeFetched(TARGET_DIRECTORY, resource)).thenReturn(false);
+    }
+
+    private void runningTestSubject() throws InterruptedException {
+        final Thread workerThread = new Thread(testSubject);
+        workerThread.start();
+        countDownLatch.await();
+        testSubject.stop();
+    }
+
+    private void assertFileContains(final File file, final String expectedContent) throws IOException {
+        try (
+            final FileReader fileReader = new FileReader(file);
+            final BufferedReader bufferedReader = new BufferedReader(fileReader)
+        ) {
+            final StringBuilder result = new StringBuilder();
+            String line = "";
+
+            while ((line = bufferedReader.readLine()) != null) {
+                result.append(line);
+            }
+
+            Assertions.assertEquals(expectedContent, result.toString());
+        }
+    }
+
+    private void assertOperationsAreFinished() throws InterruptedException {
+        waitForFileOperationsToFinish();
+        Assertions.assertFalse(testSubject.isRunning());
+        Assertions.assertEquals(actions.numberOfListings(), provider.getListCounter());
+        Assertions.assertEquals(actions.numberOfFetches(), provider.getFetchCounter());
+    }
+
+    private void verifyConflictResulotionWasNotNeeded() {
+        Mockito.verify(conflictResolutionStrategy, Mockito.never()).shouldBeFetched(Mockito.any(File.class), Mockito.any(ExternalResourceDescriptor.class));
+    }
+
+    private void verifyConflictResulotionWasNeeded(final ExternalResourceDescriptor resource, final int times) {
+        Mockito.verify(conflictResolutionStrategy, Mockito.times(times)).shouldBeFetched(TARGET_DIRECTORY, resource);
+    }
+
+    private void assertTargetFolderIsEmpty() {
+        Assertions.assertEquals(0, TARGET_DIRECTORY.list().length);
+    }
+
+    private void waitForFileOperationsToFinish() throws InterruptedException {
+        Thread.sleep(150);
+    }
+
+    private void assertTargetFolderContains(final String content, final ExternalResourceDescriptor... resources) throws IOException {
+        Assertions.assertEquals(resources.length, TARGET_DIRECTORY.list().length);
+
+        for (final ExternalResourceDescriptor resource : resources) {
+            File acquiredResource = new File(TARGET_DIRECTORY_PATH, resource.getLocation());
+            Assertions.assertTrue(acquiredResource.exists());
+            assertFileContains(acquiredResource, content);
+        }
+    }
+
+    private void assertTargetFolderContains(final String content, final ExternalResourceDescriptor resource) throws IOException {
+        assertTargetFolderContains(content, resource.getLocation());
+    }
+
+    private void assertTargetFolderContains(final String content, final String fileName) throws IOException {
+        Assertions.assertEquals(1, TARGET_DIRECTORY.list().length);
+        File acquiredResource = new File(TARGET_DIRECTORY_PATH, fileName);
+        Assertions.assertTrue(acquiredResource.exists());
+        assertFileContains(acquiredResource, content);
+    }
+
+    private void ensureGivenPathIsAccessible(final String path) {
+        final File file = new File(path);
+        file.setWritable(true);
+    }
+
+    private enum Action {
+        LIST, FETCH
+    }
+
+    private class Actions {
+        private final List<Action> actions;
+
+        Actions(final Action... actions) {
+            this.actions = Arrays.asList(actions);
+        }
+
+        int numberOfAllActions() {
+            return actions.size();
+        }
+
+        int numberOfListings() {
+            return actions.stream().filter(a -> a.equals(Action.LIST)).collect(Collectors.toList()).size();
+        }
+
+        int numberOfFetches() {
+            return actions.stream().filter(a -> a.equals(Action.FETCH)).collect(Collectors.toList()).size();
+        }
+    }
+
+    private static class TestExternalResourceProvider implements ExternalResourceProvider {
+        private final List<ExternalResourceDescriptor> resources;
+        private final Optional<CountDownLatch> countDownLatch;
+        private final List<Boolean> fetchSuccessSequence;
+
+        private final AtomicInteger listCounter = new AtomicInteger(0);
+        private final AtomicInteger fetchCounter = new AtomicInteger(0);
+
+        private TestExternalResourceProvider(final List<ExternalResourceDescriptor> resources, final CountDownLatch countDownLatch) {
+            this.countDownLatch = Optional.of(countDownLatch);
+            this.resources = resources;
+            this.fetchSuccessSequence = Collections.singletonList(true);
+        }
+
+        private TestExternalResourceProvider(final List<ExternalResourceDescriptor> resources, final CountDownLatch countDownLatch, List<Boolean> fetchSuccessSequence) {
+            this.countDownLatch = Optional.of(countDownLatch);
+            this.resources = resources;
+            this.fetchSuccessSequence = fetchSuccessSequence;
+        }
+
+        @Override
+        public void initialize(final ExternalResourceProviderInitializationContext context) {
+
+        }
+
+        @Override
+        public Collection<ExternalResourceDescriptor> listResources() {
+            listCounter.incrementAndGet();
+            countDownLatch.ifPresent(CountDownLatch::countDown);
+            return resources;
+        }
+
+        @Override
+        public InputStream fetchExternalResource(final ExternalResourceDescriptor descriptor) {
+            final boolean success = (fetchSuccessSequence.size() >= (fetchCounter.get() + 1))
+                    ? fetchSuccessSequence.get(fetchCounter.get())
+                    : fetchSuccessSequence.get(fetchSuccessSequence.size() - 1);
+
+            fetchCounter.incrementAndGet();
+            countDownLatch.ifPresent(CountDownLatch::countDown);
+
+            if (success) {
+                return new ByteArrayInputStream(CONTENT_PROVIDED.getBytes(StandardCharsets.UTF_8));
+            } else {
+                throw new RuntimeException();
+            }
+        }
+
+        public int getListCounter() {
+            return listCounter.get();
+        }
+
+        public int getFetchCounter() {
+            return fetchCounter.get();
+        }
+    }
+}
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/test/java/org/apache/nifi/flow/resource/CompositeExternalResourceProviderServiceTest.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/test/java/org/apache/nifi/flow/resource/CompositeExternalResourceProviderServiceTest.java
new file mode 100644
index 0000000000..541dcab144
--- /dev/null
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/test/java/org/apache/nifi/flow/resource/CompositeExternalResourceProviderServiceTest.java
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.flow.resource;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.mockito.Mockito;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+
+public class CompositeExternalResourceProviderServiceTest {
+
+    @Test
+    public void testWorkerThreadIsManagedCorrectly() {
+        final String threadName = Thread.currentThread().getName();
+        final TestExternalResourceProviderWorker worker = new TestExternalResourceProviderWorker();
+        final Set<ExternalResourceProviderWorker> workers = new HashSet<>();
+        workers.add(worker);
+
+        final CompositeExternalResourceProviderService testSubject = new CompositeExternalResourceProviderService("testService", workers, new CountDownLatch(0));
+        testSubject.start();
+
+        Assertions.assertTrue(worker.isRunning());
+
+        testSubject.stop();
+
+        Assertions.assertFalse(worker.isRunning());
+        Assertions.assertNotEquals(threadName, worker.threadName);
+    }
+
+    private static class TestExternalResourceProviderWorker implements ExternalResourceProviderWorker {
+        volatile String threadName;
+        volatile boolean stopped;
+
+        @Override
+        public String getName() {
+            return "name";
+        }
+
+        @Override
+        public ExternalResourceProvider getProvider() {
+            return Mockito.mock(ExternalResourceProvider.class);
+        }
+
+        @Override
+        public boolean isRunning() {
+            return !stopped;
+        }
+
+        @Override
+        public void stop() {
+            stopped = true;
+        }
+
+        @Override
+        public void run() {
+            threadName = Thread.currentThread().getName();
+
+            while (!stopped) {
+                try {
+                    Thread.sleep(10);
+                } catch (final InterruptedException e) {
+                    Thread.currentThread().interrupt();
+                    Assertions.fail();
+                    stopped = true;
+                }
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/test/java/org/apache/nifi/flow/resource/DoNotReplaceResolutionStrategyTest.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/test/java/org/apache/nifi/flow/resource/DoNotReplaceResolutionStrategyTest.java
new file mode 100644
index 0000000000..a3c00ee570
--- /dev/null
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/test/java/org/apache/nifi/flow/resource/DoNotReplaceResolutionStrategyTest.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.flow.resource;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.io.File;
+
+public class DoNotReplaceResolutionStrategyTest {
+    private static final String TARGET_DIRECTORY = "src/test/resources/";
+    private static final String RESOURCE_NAME = "resource.json";
+    private static final String OTHER_RESOURCE_NAME = "driver.jar";
+    private static final long MODIFIED_AT = System.currentTimeMillis();
+
+    private final DoNotReplaceResolutionStrategy testSubject = new DoNotReplaceResolutionStrategy();
+
+    @Test
+    public void testWhenResourceIsInPlace() {
+        final ExternalResourceDescriptor descriptor = new ImmutableExternalResourceDescriptor(RESOURCE_NAME, MODIFIED_AT);
+        final File targetDirectory = new File(TARGET_DIRECTORY);
+        final boolean result = testSubject.shouldBeFetched(targetDirectory, descriptor);
+
+        Assertions.assertFalse(result);
+    }
+
+    @Test
+    public void testWhenResourceIsNotInPlace() {
+        final ExternalResourceDescriptor descriptor = new ImmutableExternalResourceDescriptor(OTHER_RESOURCE_NAME, MODIFIED_AT);
+        final File targetDirectory = new File(TARGET_DIRECTORY);
+        final boolean result = testSubject.shouldBeFetched(targetDirectory, descriptor);
+
+        Assertions.assertTrue(result);
+    }
+}
\ No newline at end of file
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/test/java/org/apache/nifi/flow/resource/PropertyBasedExternalResourceProviderInitializationContextTest.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/test/java/org/apache/nifi/flow/resource/PropertyBasedExternalResourceProviderInitializationContextTest.java
new file mode 100644
index 0000000000..916c36b252
--- /dev/null
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/test/java/org/apache/nifi/flow/resource/PropertyBasedExternalResourceProviderInitializationContextTest.java
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.flow.resource;
+
+import org.apache.nifi.security.util.TlsException;
+import org.apache.nifi.util.NiFiProperties;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.junit.jupiter.MockitoExtension;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@ExtendWith(MockitoExtension.class)
+public class PropertyBasedExternalResourceProviderInitializationContextTest {
+    private static final String PROVIDER_NAME = "external";
+    private static final String PREFIX = "nifi.test.resources.external.provider." + PROVIDER_NAME + ".";
+
+    @Mock
+    private NiFiProperties properties;
+
+    @Test
+    public void testEmptyProperties() throws TlsException {
+        final PropertyBasedExternalResourceProviderInitializationContext testSubject = getTestSubject();
+        final Map<String, String> result = testSubject.getProperties();
+
+        Mockito.verify(properties, Mockito.times(1)).getPropertiesWithPrefix(PREFIX);
+        Assertions.assertTrue(result.isEmpty());
+    }
+
+    @Test
+    public void testGuardedPropertiesAreNotReturned() throws TlsException {
+        final Map<String, String> availableProperties = new HashMap<>();
+        availableProperties.put(PREFIX + "implementation", "value");
+        Mockito.when(properties.getPropertiesWithPrefix(PREFIX)).thenReturn(availableProperties);
+
+        final PropertyBasedExternalResourceProviderInitializationContext testSubject = getTestSubject();
+        final Map<String, String> result = testSubject.getProperties();
+
+        Mockito.verify(properties, Mockito.times(1)).getPropertiesWithPrefix(PREFIX);
+        Assertions.assertTrue(result.isEmpty());
+    }
+
+    @Test
+    public void testPropertiesWouldHaveEmptyKeyAreNotReturned() throws TlsException {
+        final Map<String, String> availableProperties = new HashMap<>();
+        availableProperties.put(PREFIX, "value");
+        Mockito.when(properties.getPropertiesWithPrefix(PREFIX)).thenReturn(availableProperties);
+
+        final PropertyBasedExternalResourceProviderInitializationContext testSubject = getTestSubject();
+        final Map<String, String> result = testSubject.getProperties();
+
+        Mockito.verify(properties, Mockito.times(1)).getPropertiesWithPrefix(PREFIX);
+        Assertions.assertTrue(result.isEmpty());
+    }
+
+    @Test
+    public void testPrefixIsRemoved() throws TlsException {
+        final Map<String, String> availableProperties = new HashMap<>();
+        availableProperties.put(PREFIX + "key1", "value1");
+        availableProperties.put(PREFIX + "key2", "value2");
+        Mockito.when(properties.getPropertiesWithPrefix(PREFIX)).thenReturn(availableProperties);
+
+        final PropertyBasedExternalResourceProviderInitializationContext testSubject = getTestSubject();
+        final Map<String, String> result = testSubject.getProperties();
+
+        Mockito.verify(properties, Mockito.times(1)).getPropertiesWithPrefix(PREFIX);
+        Assertions.assertEquals(2, result.size());
+        Assertions.assertTrue(result.containsKey("key1"));
+        Assertions.assertTrue(result.containsKey("key2"));
+        Assertions.assertEquals("value1", result.get("key1"));
+        Assertions.assertEquals("value2", result.get("key2"));
+    }
+
+    private PropertyBasedExternalResourceProviderInitializationContext getTestSubject() throws TlsException {
+        return new PropertyBasedExternalResourceProviderInitializationContext(properties, PREFIX, (descriptor -> true));
+    }
+}
\ No newline at end of file
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/test/java/org/apache/nifi/flow/resource/ReplaceWithNewerResolutionStrategyTest.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/test/java/org/apache/nifi/flow/resource/ReplaceWithNewerResolutionStrategyTest.java
new file mode 100644
index 0000000000..ee452e8b15
--- /dev/null
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/test/java/org/apache/nifi/flow/resource/ReplaceWithNewerResolutionStrategyTest.java
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.flow.resource;
+
+import org.apache.nifi.util.FileUtils;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.io.File;
+import java.io.IOException;
+
+public class ReplaceWithNewerResolutionStrategyTest {
+    private static final String TARGET_DIRECTORY = "src/test/resources/";
+    private static final String OTHER_TARGET_DIRECTORY = TARGET_DIRECTORY + "t1";
+    private static final String RESOURCE_NAME = "resource.json";
+    private static final String OTHER_RESOURCE_NAME = "driver.jar";
+
+    private final ReplaceWithNewerResolutionStrategy testSubject = new ReplaceWithNewerResolutionStrategy();
+
+
+    @Test
+    public void testEmptyFolder() throws IOException {
+        // given
+        final File targetDirectory = new File(OTHER_TARGET_DIRECTORY);
+        final ExternalResourceDescriptor descriptor = new ImmutableExternalResourceDescriptor(RESOURCE_NAME, System.currentTimeMillis());
+        FileUtils.ensureDirectoryExistAndCanReadAndWrite(targetDirectory);
+
+        // when
+        final boolean result = testSubject.shouldBeFetched(targetDirectory, descriptor);
+
+        // then
+        Assertions.assertTrue(result);
+        FileUtils.deleteFile(targetDirectory, true);
+    }
+
+    @Test
+    public void testFolderWithoutMatchingFile() {
+        // given
+        final File targetDirectory = new File(TARGET_DIRECTORY);
+        final ExternalResourceDescriptor descriptor = new ImmutableExternalResourceDescriptor(OTHER_RESOURCE_NAME, System.currentTimeMillis());
+
+        // when
+        final boolean result = testSubject.shouldBeFetched(targetDirectory, descriptor);
+
+        // then
+        Assertions.assertTrue(result);
+    }
+
+    @Test
+    public void testFolderWithMatchingFileWhenNoNewerCandidate() {
+        // given
+        final File targetDirectory = new File(TARGET_DIRECTORY);
+        final File existingResource = new File(targetDirectory, RESOURCE_NAME);
+        final ExternalResourceDescriptor descriptor = new ImmutableExternalResourceDescriptor(RESOURCE_NAME, existingResource.lastModified() - 1);
+
+        // when
+        final boolean result = testSubject.shouldBeFetched(targetDirectory, descriptor);
+
+        // then
+        Assertions.assertFalse(result);
+    }
+
+    @Test
+    public void testFolderWithMatchingFileWhenTheCandidateHasTheSameAge() {
+        // given
+        final File targetDirectory = new File(TARGET_DIRECTORY);
+        final File existingResource = new File(targetDirectory, RESOURCE_NAME);
+        final ExternalResourceDescriptor descriptor = new ImmutableExternalResourceDescriptor(RESOURCE_NAME, existingResource.lastModified());
+
+        // when
+        final boolean result = testSubject.shouldBeFetched(targetDirectory, descriptor);
+
+        // then
+        Assertions.assertFalse(result);
+    }
+
+    @Test
+    public void testFolderWithMatchingFileWhenThereIsNewerCandidate() {
+        // given
+        final File targetDirectory = new File(TARGET_DIRECTORY);
+        final File existingResource = new File(targetDirectory, RESOURCE_NAME);
+        final ExternalResourceDescriptor descriptor = new ImmutableExternalResourceDescriptor(RESOURCE_NAME, existingResource.lastModified() + 1);
+
+        // when
+        final boolean result = testSubject.shouldBeFetched(targetDirectory, descriptor);
+
+        // then
+        Assertions.assertTrue(result);
+    }
+}
\ No newline at end of file
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/test/resources/resource.json b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-external-resource-utils/src/test/resources/resource.json
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/pom.xml
index 96ffbd56df..b9d0ccc707 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/pom.xml
@@ -71,6 +71,16 @@
             <artifactId>nifi-property-encryptor</artifactId>
             <version>1.17.0-SNAPSHOT</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.nifi</groupId>
+            <artifactId>nifi-framework-external-resource-utils</artifactId>
+            <version>1.17.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.nifi</groupId>
+            <artifactId>nifi-external-resource-utils</artifactId>
+            <version>1.17.0-SNAPSHOT</version>
+        </dependency>
 
         <dependency>
             <groupId>org.apache.nifi.registry</groupId>
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/extension/AbstractExtensionBundleMetadata.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/extension/AbstractExtensionBundleMetadata.java
index a1d93eb5d6..627a9c0322 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/extension/AbstractExtensionBundleMetadata.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/extension/AbstractExtensionBundleMetadata.java
@@ -29,12 +29,14 @@ public class AbstractExtensionBundleMetadata implements ExtensionBundleMetadata
     private final String group;
     private final String artifact;
     private final String version;
+    private final long timestamp;
 
-    public AbstractExtensionBundleMetadata(final String registryIdentifier, final String group, final String artifact, final String version) {
+    public AbstractExtensionBundleMetadata(final String registryIdentifier, final String group, final String artifact, final String version, final long timestamp) {
         this.registryIdentifier = Validate.notBlank(registryIdentifier);
         this.group = Validate.notBlank(group);
         this.artifact = Validate.notBlank(artifact);
         this.version = Validate.notBlank(version);
+        this.timestamp = timestamp;
     }
 
     @Override
@@ -57,6 +59,11 @@ public class AbstractExtensionBundleMetadata implements ExtensionBundleMetadata
         return version;
     }
 
+    @Override
+    public long getTimestamp() {
+        return timestamp;
+    }
+
     @Override
     public int hashCode() {
         return Objects.hash(group, artifact, version, registryIdentifier);
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/extension/NiFiRegistryExtensionBundleMetadata.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/extension/NiFiRegistryExtensionBundleMetadata.java
index 828b464a2d..44d3255337 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/extension/NiFiRegistryExtensionBundleMetadata.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/extension/NiFiRegistryExtensionBundleMetadata.java
@@ -30,7 +30,7 @@ public class NiFiRegistryExtensionBundleMetadata extends AbstractExtensionBundle
     private final String bundleIdentifier;
 
     private NiFiRegistryExtensionBundleMetadata(final Builder builder) {
-        super(builder.registryIdentifier, builder.group, builder.artifact, builder.version);
+        super(builder.registryIdentifier, builder.group, builder.artifact, builder.version, builder.timestamp);
         this.bundleIdentifier = Validate.notBlank(builder.bundleIdentifier);
     }
 
@@ -76,6 +76,7 @@ public class NiFiRegistryExtensionBundleMetadata extends AbstractExtensionBundle
         private String artifact;
         private String version;
         private String bundleIdentifier;
+        private long timestamp;
 
         public Builder registryIdentifier(final String registryIdentifier) {
             this.registryIdentifier = registryIdentifier;
@@ -102,6 +103,11 @@ public class NiFiRegistryExtensionBundleMetadata extends AbstractExtensionBundle
             return this;
         }
 
+        public Builder timestamp(final long timestamp) {
+            this.timestamp = timestamp;
+            return this;
+        }
+
         public NiFiRegistryExtensionBundleMetadata build() {
             return new NiFiRegistryExtensionBundleMetadata(this);
         }
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/extension/NiFiRegistryExtensionRegistry.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/extension/NiFiRegistryExtensionRegistry.java
index fae0714b20..681bbf69b8 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/extension/NiFiRegistryExtensionRegistry.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/extension/NiFiRegistryExtensionRegistry.java
@@ -118,6 +118,7 @@ public class NiFiRegistryExtensionRegistry extends AbstractExtensionRegistry<NiF
                 .artifact(bundleVersionMetadata.getArtifactId())
                 .version(bundleVersionMetadata.getVersion())
                 .bundleIdentifier(bundleVersionMetadata.getBundleId())
+                .timestamp(bundleVersionMetadata.getTimestamp())
                 .registryIdentifier(getIdentifier())
                 .build();
     }
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/extension/NiFiRegistryNarProvider.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/extension/NiFiRegistryExternalResourceProvider.java
similarity index 72%
copy from nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/extension/NiFiRegistryNarProvider.java
copy to nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/extension/NiFiRegistryExternalResourceProvider.java
index f8b8bffe8f..1862097179 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/extension/NiFiRegistryNarProvider.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/extension/NiFiRegistryExternalResourceProvider.java
@@ -16,8 +16,10 @@
  */
 package org.apache.nifi.registry.extension;
 
-import org.apache.nifi.nar.NarProvider;
-import org.apache.nifi.nar.NarProviderInitializationContext;
+import org.apache.nifi.flow.resource.ExternalResourceDescriptor;
+import org.apache.nifi.flow.resource.ExternalResourceProvider;
+import org.apache.nifi.flow.resource.ExternalResourceProviderInitializationContext;
+import org.apache.nifi.flow.resource.ImmutableExternalResourceDescriptor;
 import org.apache.nifi.util.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -30,18 +32,8 @@ import java.util.Collections;
 import java.util.Set;
 import java.util.stream.Collectors;
 
-/**
- * NarProvider implementation that retrieves NARs from NiFi Registry. The current implementation will retrieve bundles
- * from all buckets that the NiFi server is authorized to read from (generally will be all buckets).
- *
- * Example configuration for nifi.properties:
- *   nifi.nar.library.provider.nifi-registry.implementation=org.apache.nifi.registry.extension.NiFiRegistryNarProvider
- *   nifi.nar.library.provider.nifi-registry.url=http://localhost:18080
- *
- */
-public class NiFiRegistryNarProvider implements NarProvider {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(NiFiRegistryNarProvider.class);
+public class NiFiRegistryExternalResourceProvider implements ExternalResourceProvider {
+    private static final Logger LOGGER = LoggerFactory.getLogger(NiFiRegistryExternalResourceProvider.class);
 
     private static final String NIFI_REGISTRY_CLIENT_ID = "nifi-registry-nar-provider";
     private static final String NIFI_REGISTRY_CLIENT_NAME = "NiFi Registry NAR Provider";
@@ -52,13 +44,13 @@ public class NiFiRegistryNarProvider implements NarProvider {
     private volatile boolean initialized = false;
 
     @Override
-    public void initialize(final NarProviderInitializationContext initializationContext) {
-        final String url = initializationContext.getProperties().get(URL_PROPERTY);
+    public void initialize(final ExternalResourceProviderInitializationContext context) {
+        final String url = context.getProperties().get(URL_PROPERTY);
         if (StringUtils.isBlank(url)) {
             throw new IllegalArgumentException("NiFiRegistryNarProvider requires a `url` property");
         }
 
-        final SSLContext sslContext = initializationContext.getNiFiSSLContext();
+        final SSLContext sslContext = context.getSSLContext();
         if (url.startsWith("https") && sslContext == null) {
             throw new IllegalStateException("NiFi TLS properties must be specified in order to connect to NiFi Registry via https");
         }
@@ -68,14 +60,14 @@ public class NiFiRegistryNarProvider implements NarProvider {
     }
 
     @Override
-    public Collection<String> listNars() throws IOException {
+    public Collection<ExternalResourceDescriptor> listResources() throws IOException {
         if (!initialized) {
             LOGGER.error("Provider is not initialized");
         }
 
         try {
             final Set<NiFiRegistryExtensionBundleMetadata> bundleMetadata = extensionRegistry.getExtensionBundleMetadata(null);
-            return bundleMetadata.stream().map(bm -> bm.toLocationString()).collect(Collectors.toSet());
+            return bundleMetadata.stream().map(bm ->  new ImmutableExternalResourceDescriptor(bm.toLocationString(), bm.getTimestamp())).collect(Collectors.toSet());
         } catch (final ExtensionRegistryException ere) {
             LOGGER.error("Unable to retrieve listing of NARs from NiFi Registry at [{}]", extensionRegistry.getURL(), ere);
             return Collections.emptySet();
@@ -83,12 +75,12 @@ public class NiFiRegistryNarProvider implements NarProvider {
     }
 
     @Override
-    public InputStream fetchNarContents(final String location) throws IOException {
+    public InputStream fetchExternalResource(final ExternalResourceDescriptor descriptor) throws IOException {
         if (!initialized) {
             LOGGER.error("Provider is not initialized");
         }
 
-        final NiFiRegistryExtensionBundleMetadata bundleMetadata = NiFiRegistryExtensionBundleMetadata.fromLocationString(location)
+        final NiFiRegistryExtensionBundleMetadata bundleMetadata = NiFiRegistryExtensionBundleMetadata.fromLocationString(descriptor.getLocation())
                 .registryIdentifier(extensionRegistry.getIdentifier())
                 .build();
 
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/extension/NiFiRegistryNarProvider.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/extension/NiFiRegistryNarProvider.java
index f8b8bffe8f..9fd3b6b26a 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/extension/NiFiRegistryNarProvider.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/extension/NiFiRegistryNarProvider.java
@@ -16,18 +16,14 @@
  */
 package org.apache.nifi.registry.extension;
 
+import org.apache.nifi.flow.resource.ImmutableExternalResourceDescriptor;
+import org.apache.nifi.flow.resource.NarProviderAdapterInitializationContext;
 import org.apache.nifi.nar.NarProvider;
 import org.apache.nifi.nar.NarProviderInitializationContext;
-import org.apache.nifi.util.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
-import javax.net.ssl.SSLContext;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Collection;
-import java.util.Collections;
-import java.util.Set;
 import java.util.stream.Collectors;
 
 /**
@@ -39,66 +35,23 @@ import java.util.stream.Collectors;
  *   nifi.nar.library.provider.nifi-registry.url=http://localhost:18080
  *
  */
-public class NiFiRegistryNarProvider implements NarProvider {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(NiFiRegistryNarProvider.class);
-
-    private static final String NIFI_REGISTRY_CLIENT_ID = "nifi-registry-nar-provider";
-    private static final String NIFI_REGISTRY_CLIENT_NAME = "NiFi Registry NAR Provider";
-
-    static final String URL_PROPERTY = "url";
-
-    private volatile NiFiRegistryExtensionRegistry extensionRegistry;
-    private volatile boolean initialized = false;
+@Deprecated
+public class NiFiRegistryNarProvider extends NiFiRegistryExternalResourceProvider implements NarProvider {
 
     @Override
-    public void initialize(final NarProviderInitializationContext initializationContext) {
-        final String url = initializationContext.getProperties().get(URL_PROPERTY);
-        if (StringUtils.isBlank(url)) {
-            throw new IllegalArgumentException("NiFiRegistryNarProvider requires a `url` property");
-        }
-
-        final SSLContext sslContext = initializationContext.getNiFiSSLContext();
-        if (url.startsWith("https") && sslContext == null) {
-            throw new IllegalStateException("NiFi TLS properties must be specified in order to connect to NiFi Registry via https");
-        }
-
-        extensionRegistry = new NiFiRegistryExtensionRegistry(NIFI_REGISTRY_CLIENT_ID, url, NIFI_REGISTRY_CLIENT_NAME, sslContext);
-        initialized = true;
+    public void initialize(final NarProviderInitializationContext context) {
+        initialize(new NarProviderAdapterInitializationContext(context));
     }
 
     @Override
     public Collection<String> listNars() throws IOException {
-        if (!initialized) {
-            LOGGER.error("Provider is not initialized");
-        }
-
-        try {
-            final Set<NiFiRegistryExtensionBundleMetadata> bundleMetadata = extensionRegistry.getExtensionBundleMetadata(null);
-            return bundleMetadata.stream().map(bm -> bm.toLocationString()).collect(Collectors.toSet());
-        } catch (final ExtensionRegistryException ere) {
-            LOGGER.error("Unable to retrieve listing of NARs from NiFi Registry at [{}]", extensionRegistry.getURL(), ere);
-            return Collections.emptySet();
-        }
+        // Only NARs will be listed due to the filter in {@code HDFSNarProviderInitializationContext}
+        return listResources().stream().map(d -> d.getLocation()).collect(Collectors.toList());
     }
 
     @Override
-    public InputStream fetchNarContents(final String location) throws IOException {
-        if (!initialized) {
-            LOGGER.error("Provider is not initialized");
-        }
-
-        final NiFiRegistryExtensionBundleMetadata bundleMetadata = NiFiRegistryExtensionBundleMetadata.fromLocationString(location)
-                .registryIdentifier(extensionRegistry.getIdentifier())
-                .build();
-
-        LOGGER.debug("Fetching NAR contents for bundleIdentifier [{}] and version [{}]",
-                bundleMetadata.getBundleIdentifier(), bundleMetadata.getVersion());
-
-        try {
-            return extensionRegistry.getExtensionBundleContent(null, bundleMetadata);
-        } catch (ExtensionRegistryException e) {
-            throw new RuntimeException(e.getMessage(), e);
-        }
+    public InputStream fetchNarContents(String location) throws IOException {
+        // Nar provider does not support modification time based fetch
+        return fetchExternalResource(new ImmutableExternalResourceDescriptor(location, System.currentTimeMillis()));
     }
 }
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/registry/extension/ExtensionBundleMetadata.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/registry/extension/ExtensionBundleMetadata.java
index 856b769a4a..034c8c0f72 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/registry/extension/ExtensionBundleMetadata.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/registry/extension/ExtensionBundleMetadata.java
@@ -41,4 +41,9 @@ public interface ExtensionBundleMetadata {
      */
     String getVersion();
 
+    /**
+     * @return timestamp of the bundle
+     */
+    long getTimestamp();
+
 }
\ No newline at end of file
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/META-INF/services/org.apache.nifi.flow.resource.ExternalResourceProvider b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/META-INF/services/org.apache.nifi.flow.resource.ExternalResourceProvider
new file mode 100644
index 0000000000..577768225f
--- /dev/null
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/META-INF/services/org.apache.nifi.flow.resource.ExternalResourceProvider
@@ -0,0 +1,15 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+org.apache.nifi.registry.extension.NiFiRegistryExternalResourceProvider
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-loading-utils/src/main/java/org/apache/nifi/nar/NarAutoLoader.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-loading-utils/src/main/java/org/apache/nifi/nar/NarAutoLoader.java
index d33d20bf10..b3a8d1e98e 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-loading-utils/src/main/java/org/apache/nifi/nar/NarAutoLoader.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-loading-utils/src/main/java/org/apache/nifi/nar/NarAutoLoader.java
@@ -28,34 +28,25 @@ import java.nio.file.FileSystems;
 import java.nio.file.Path;
 import java.nio.file.StandardWatchEventKinds;
 import java.nio.file.WatchService;
-import java.util.HashSet;
 import java.util.Objects;
-import java.util.Set;
-import java.util.UUID;
 
 /**
  * Starts a thread to monitor the auto-load directory for new NARs.
  */
 public class NarAutoLoader {
     private static final Logger LOGGER = LoggerFactory.getLogger(NarAutoLoader.class);
-    private static final String NAR_PROVIDER_PREFIX = "nifi.nar.library.provider.";
-    private static final String IMPLEMENTATION_PROPERTY = "implementation";
 
     private static final long POLL_INTERVAL_MS = 5000;
-    private static final long POLL_INTERVAL_NAR_PROVIDER_MS = 300000;
 
     private final NiFiProperties properties;
     private final NarLoader narLoader;
-    private final ExtensionManager extensionManager;
 
-    private volatile Set<NarProviderTask> narProviderTasks;
     private volatile NarAutoLoaderTask narAutoLoaderTask;
     private volatile boolean started = false;
 
-    public NarAutoLoader(final NiFiProperties properties, final NarLoader narLoader, final ExtensionManager extensionManager) {
+    public NarAutoLoader(final NiFiProperties properties, final NarLoader narLoader) {
         this.properties = Objects.requireNonNull(properties);
         this.narLoader = Objects.requireNonNull(narLoader);
-        this.extensionManager = Objects.requireNonNull(extensionManager);
     }
 
     public synchronized void start() throws IllegalAccessException, InstantiationException, ClassNotFoundException, IOException, TlsException {
@@ -83,29 +74,6 @@ public class NarAutoLoader {
         autoLoaderThread.setName("NAR Auto-Loader");
         autoLoaderThread.setDaemon(true);
         autoLoaderThread.start();
-
-        narProviderTasks = new HashSet<>();
-
-        for (final String externalSourceName : properties.getDirectSubsequentTokens(NAR_PROVIDER_PREFIX)) {
-            LOGGER.info("NAR Provider {} found in configuration", externalSourceName);
-
-            final NarProviderInitializationContext context = new PropertyBasedNarProviderInitializationContext(properties, externalSourceName);
-            final String implementationClass = properties.getProperty(NAR_PROVIDER_PREFIX + externalSourceName + "." + IMPLEMENTATION_PROPERTY);
-            final String providerId = UUID.randomUUID().toString();
-            final NarProvider provider = NarThreadContextClassLoader.createInstance(extensionManager, implementationClass, NarProvider.class, properties, providerId);
-            provider.initialize(context);
-
-            final ClassLoader instanceClassLoader = extensionManager.getInstanceClassLoader(providerId);
-            final ClassLoader providerClassLoader = instanceClassLoader == null ? provider.getClass().getClassLoader() : instanceClassLoader;
-            final NarProviderTask task = new NarProviderTask(provider, providerClassLoader, properties.getNarAutoLoadDirectory(), POLL_INTERVAL_NAR_PROVIDER_MS);
-            narProviderTasks.add(task);
-
-            final Thread providerThread = new Thread(task);
-            providerThread.setName("NAR Provider Task - " + externalSourceName);
-            providerThread.setDaemon(true);
-            providerThread.setContextClassLoader(provider.getClass().getClassLoader());
-            providerThread.start();
-        }
     }
 
     public synchronized void stop() {
@@ -115,11 +83,6 @@ public class NarAutoLoader {
             narAutoLoaderTask = null;
         }
 
-        if (narProviderTasks != null) {
-            narProviderTasks.forEach(NarProviderTask::stop);
-            narProviderTasks = null;
-        }
-
         LOGGER.info("NAR Auto-Loader stopped");
     }
 }
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-loading-utils/src/main/java/org/apache/nifi/nar/NarProviderTask.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-loading-utils/src/main/java/org/apache/nifi/nar/NarProviderTask.java
deleted file mode 100644
index 44996859a9..0000000000
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-loading-utils/src/main/java/org/apache/nifi/nar/NarProviderTask.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.nifi.nar;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.io.InputStream;
-import java.nio.file.Files;
-import java.nio.file.StandardCopyOption;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Set;
-import java.util.UUID;
-import java.util.stream.Collectors;
-
-final class NarProviderTask implements Runnable {
-    private static final Logger LOGGER = LoggerFactory.getLogger(NarProviderTask.class);
-    private static final String NAR_EXTENSION = "nar";
-
-    // A unique id is necessary for temporary files not to collide with temporary files from other instances.
-    private final String id = UUID.randomUUID().toString();
-
-    private final NarProvider narProvider;
-    private final ClassLoader narProviderClassLoader;
-    private final long pollTimeInMs;
-    private final File extensionDirectory;
-
-    private volatile boolean stopped = false;
-
-    NarProviderTask(final NarProvider narProvider, final ClassLoader narProviderClassLoader, final File extensionDirectory, final long pollTimeInMs) {
-        this.narProvider = narProvider;
-        this.narProviderClassLoader = narProviderClassLoader;
-        this.pollTimeInMs = pollTimeInMs;
-        this.extensionDirectory = extensionDirectory;
-    }
-
-    @Override
-    public void run() {
-        LOGGER.info("Nar provider task is started");
-
-        while (!stopped) {
-            try {
-                LOGGER.debug("Task starts fetching NARs from provider");
-                final Set<String> loadedNars = getLoadedNars();
-                final Collection<String> availableNars;
-                try (final NarCloseable narCloseable = NarCloseable.withComponentNarLoader(narProviderClassLoader)) {
-                    availableNars = narProvider.listNars();
-                }
-
-                for (final String availableNar : availableNars) {
-                    if (!loadedNars.contains(availableNar)) {
-                        final long startedAt = System.currentTimeMillis();
-                        final InputStream inputStream;
-
-                        try (final NarCloseable narCloseable = NarCloseable.withComponentNarLoader(narProviderClassLoader)) {
-                            inputStream = narProvider.fetchNarContents(availableNar);
-                        }
-
-                        final File tempFile = new File(extensionDirectory, ".tmp_" + id + ".nar");
-                        final File targetFile = new File(extensionDirectory, availableNar);
-                        Files.copy(inputStream, tempFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
-                        tempFile.renameTo(targetFile);
-
-                        LOGGER.info("Downloaded NAR {} in {} ms", availableNar, (System.currentTimeMillis() - startedAt));
-                    }
-                }
-
-                LOGGER.debug("Task finished fetching NARs from provider");
-            } catch (final Throwable e) {
-                LOGGER.error("Error during reaching the external source", e);
-            }
-
-            try {
-                Thread.sleep(pollTimeInMs);
-            } catch (final InterruptedException e) {
-                Thread.currentThread().interrupt();
-                LOGGER.warn("NAR autoloader external source task is interrupted");
-                stopped = true;
-            }
-        }
-    }
-
-    private Set<String> getLoadedNars() {
-        return Arrays.stream(extensionDirectory.listFiles(file -> file.isFile() && file.getName().toLowerCase().endsWith("." + NAR_EXTENSION)))
-                .map(file -> file.getName())
-                .collect(Collectors.toSet());
-    }
-
-    void stop() {
-        LOGGER.info("Nar provider task is stopped");
-        stopped = true;
-    }
-}
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-loading-utils/src/main/java/org/apache/nifi/nar/PropertyBasedNarProviderInitializationContext.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-loading-utils/src/main/java/org/apache/nifi/nar/PropertyBasedNarProviderInitializationContext.java
index 4f5edd0b01..a4ae614b77 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-loading-utils/src/main/java/org/apache/nifi/nar/PropertyBasedNarProviderInitializationContext.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-loading-utils/src/main/java/org/apache/nifi/nar/PropertyBasedNarProviderInitializationContext.java
@@ -16,6 +16,7 @@
  */
 package org.apache.nifi.nar;
 
+import org.apache.nifi.flow.resource.ExternalResourceProviderInitializationContext;
 import org.apache.nifi.security.util.SslContextFactory;
 import org.apache.nifi.security.util.StandardTlsConfiguration;
 import org.apache.nifi.security.util.TlsConfiguration;
@@ -32,7 +33,7 @@ import java.util.Set;
 /**
  * A facade at front of {@code NiFiProperties} for auto loader extensions. Also limits the scope of the reachable properties.
  */
-public class PropertyBasedNarProviderInitializationContext implements NarProviderInitializationContext {
+public class PropertyBasedNarProviderInitializationContext implements NarProviderInitializationContext, ExternalResourceProviderInitializationContext {
     private static Set<String> GUARDED_PROPERTIES = new HashSet<>(Arrays.asList("implementation"));
     static final String BASIC_PREFIX = "nifi.nar.library.provider.";
 
@@ -56,6 +57,11 @@ public class PropertyBasedNarProviderInitializationContext implements NarProvide
         return sslContext;
     }
 
+    @Override
+    public SSLContext getSSLContext() {
+        return sslContext;
+    }
+
     private Map<String, String> extractProperties(final NiFiProperties properties, final String name) {
         final String prefix = BASIC_PREFIX + name + ".";
         final Map<String, String> candidates = properties.getPropertiesWithPrefix(prefix);
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-utils/src/main/java/org/apache/nifi/nar/StandardExtensionDiscoveringManager.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-utils/src/main/java/org/apache/nifi/nar/StandardExtensionDiscoveringManager.java
index f8e1806abf..948eead553 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-utils/src/main/java/org/apache/nifi/nar/StandardExtensionDiscoveringManager.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-utils/src/main/java/org/apache/nifi/nar/StandardExtensionDiscoveringManager.java
@@ -33,6 +33,7 @@ import org.apache.nifi.controller.repository.FlowFileRepository;
 import org.apache.nifi.controller.repository.FlowFileSwapManager;
 import org.apache.nifi.controller.status.analytics.StatusAnalyticsModel;
 import org.apache.nifi.controller.status.history.StatusHistoryRepository;
+import org.apache.nifi.flow.resource.ExternalResourceProvider;
 import org.apache.nifi.flowfile.FlowFilePrioritizer;
 import org.apache.nifi.init.ConfigurableComponentInitializer;
 import org.apache.nifi.init.ConfigurableComponentInitializerFactory;
@@ -111,6 +112,7 @@ public class StandardExtensionDiscoveringManager implements ExtensionDiscovering
         definitionMap.put(StateProvider.class, new HashSet<>());
         definitionMap.put(StatusAnalyticsModel.class, new HashSet<>());
         definitionMap.put(NarProvider.class, new HashSet<>());
+        definitionMap.put(ExternalResourceProvider.class, new HashSet<>());
 
         additionalExtensionTypes.forEach(type -> definitionMap.putIfAbsent(type, new HashSet<>()));
     }
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-headless-server/src/main/java/org/apache/nifi/headless/HeadlessNiFiServer.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-headless-server/src/main/java/org/apache/nifi/headless/HeadlessNiFiServer.java
index c862b94a11..9a906afa14 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-headless-server/src/main/java/org/apache/nifi/headless/HeadlessNiFiServer.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-headless-server/src/main/java/org/apache/nifi/headless/HeadlessNiFiServer.java
@@ -176,7 +176,7 @@ public class HeadlessNiFiServer implements NiFiServer {
                     new ExtensionMapping(), // Mapping is for documentation which is for the UI, not headless
                     null); // UI Loader is for documentation which is for the UI, not headless
 
-            narAutoLoader = new NarAutoLoader(props, narLoader, extensionManager);
+            narAutoLoader = new NarAutoLoader(props, narLoader);
             narAutoLoader.start();
             logger.info("Flow loaded successfully.");
         } catch (Exception e) {
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/nifi.properties b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/nifi.properties
index f2609283f2..1426b27280 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/nifi.properties
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/nifi.properties
@@ -354,7 +354,7 @@ nifi.diagnostics.on.shutdown.max.directory.size=10 MB
 # Each NAR provider must have at least one property named "implementation".
 #
 # Example HDFS NAR Provider:
-#   nifi.nar.library.provider.hdfs.implementation=org.apache.nifi.nar.hadoop.HDFSNarProvider
+#   nifi.nar.library.provider.hdfs.implementation=org.apache.nifi.flow.resource.hadoop.HDFSExternalResourceProvider
 #   nifi.nar.library.provider.hdfs.resources=/path/to/core-site.xml,/path/to/hdfs-site.xml
 #   nifi.nar.library.provider.hdfs.storage.location=hdfs://hdfs-location
 #   nifi.nar.library.provider.hdfs.source.directory=/nars
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/pom.xml
index 0141b103e9..07b052e923 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/pom.xml
@@ -47,6 +47,11 @@
             <artifactId>nifi-framework-nar-loading-utils</artifactId>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.nifi</groupId>
+            <artifactId>nifi-framework-external-resource-utils</artifactId>
+            <scope>provided</scope>
+        </dependency>
         <dependency>
             <groupId>org.apache.nifi</groupId>
             <artifactId>nifi-nar-utils</artifactId>
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java
index 1ba0437ee3..f4d794ec8a 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java
@@ -31,19 +31,30 @@ import org.apache.nifi.diagnostics.DiagnosticsDumpElement;
 import org.apache.nifi.diagnostics.DiagnosticsFactory;
 import org.apache.nifi.diagnostics.ThreadDumpTask;
 import org.apache.nifi.documentation.DocGenerator;
+import org.apache.nifi.flow.resource.ExternalResourceDescriptor;
+import org.apache.nifi.flow.resource.ExternalResourceProvider;
+import org.apache.nifi.flow.resource.ExternalResourceProviderInitializationContext;
+import org.apache.nifi.flow.resource.ExternalResourceProviderService;
+import org.apache.nifi.flow.resource.ExternalResourceProviderServiceBuilder;
+import org.apache.nifi.flow.resource.NarProviderAdapter;
+import org.apache.nifi.flow.resource.PropertyBasedExternalResourceProviderInitializationContext;
 import org.apache.nifi.lifecycle.LifeCycleStartException;
 import org.apache.nifi.nar.ExtensionDiscoveringManager;
+import org.apache.nifi.nar.ExtensionManager;
 import org.apache.nifi.nar.ExtensionManagerHolder;
 import org.apache.nifi.nar.ExtensionMapping;
 import org.apache.nifi.nar.ExtensionUiLoader;
 import org.apache.nifi.nar.NarAutoLoader;
 import org.apache.nifi.nar.NarClassLoadersHolder;
 import org.apache.nifi.nar.NarLoader;
+import org.apache.nifi.nar.NarProvider;
+import org.apache.nifi.nar.NarThreadContextClassLoader;
 import org.apache.nifi.nar.StandardExtensionDiscoveringManager;
 import org.apache.nifi.nar.StandardNarLoader;
 import org.apache.nifi.processor.DataUnit;
 import org.apache.nifi.security.util.KeyStoreUtils;
 import org.apache.nifi.security.util.TlsConfiguration;
+import org.apache.nifi.security.util.TlsException;
 import org.apache.nifi.services.FlowService;
 import org.apache.nifi.ui.extension.UiExtension;
 import org.apache.nifi.ui.extension.UiExtensionMapping;
@@ -118,7 +129,9 @@ import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
+import java.util.UUID;
 import java.util.concurrent.TimeUnit;
+import java.util.function.Predicate;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 import java.util.stream.Collectors;
@@ -143,6 +156,15 @@ public class JettyServer implements NiFiServer, ExtensionUiLoader {
 
     private static final RequestFilterProvider REQUEST_FILTER_PROVIDER = new StandardRequestFilterProvider();
     private static final RequestFilterProvider REST_API_REQUEST_FILTER_PROVIDER = new RestApiRequestFilterProvider();
+    private static final String NAR_PROVIDER_PREFIX = "nifi.nar.library.provider.";
+    private static final String NAR_PROVIDER_POLL_INTERVAL_PROPERTY = "nifi.nar.library.poll.interval";
+    private static final String NAR_PROVIDER_CONFLICT_RESOLUTION = "nifi.nar.library.conflict.resolution";
+    private static final String NAR_PROVIDER_RESTRAIN_PROPERTY = "nifi.nar.library.restrain.startup";
+    private static final String NAR_PROVIDER_IMPLEMENTATION_PROPERTY = "implementation";
+    private static final String DEFAULT_NAR_PROVIDER_POLL_INTERVAL = "5 min";
+    private static final String DEFAULT_NAR_PROVIDER_CONFLICT_RESOLUTION = "IGNORE";
+
+    private static final int DOS_FILTER_REJECT_REQUEST = -1;
 
     private static final FileFilter WAR_FILTER = pathname -> {
         final String nameToTest = pathname.getName().toLowerCase();
@@ -160,6 +182,7 @@ public class JettyServer implements NiFiServer, ExtensionUiLoader {
     private Set<Bundle> bundles;
     private ExtensionMapping extensionMapping;
     private NarAutoLoader narAutoLoader;
+    private ExternalResourceProviderService narProviderService;
     private DiagnosticsFactory diagnosticsFactory;
     private SslContextFactory.Server sslContextFactory;
     private DecommissionTask decommissionTask;
@@ -1004,6 +1027,27 @@ public class JettyServer implements NiFiServer, ExtensionUiLoader {
             // Generate docs for extensions
             DocGenerator.generate(props, extensionManager, extensionMapping);
 
+            // Additionally loaded NARs and collected flow resources must be in place before starting the flows
+            final NarLoader narLoader = new StandardNarLoader(
+                    props.getExtensionsWorkingDirectory(),
+                    props.getComponentDocumentationWorkingDirectory(),
+                    NarClassLoadersHolder.getInstance(),
+                    extensionManager,
+                    extensionMapping,
+                    this);
+
+            narAutoLoader = new NarAutoLoader(props, narLoader);
+            narAutoLoader.start();
+
+            narProviderService = new ExternalResourceProviderServiceBuilder("NAR Auto-Loader Provider", extensionManager)
+                    .providers(buildExternalResourceProviders(extensionManager, NAR_PROVIDER_PREFIX, descriptor -> descriptor.getLocation().toLowerCase().endsWith(".nar")))
+                    .targetDirectory(new File(props.getProperty(NiFiProperties.NAR_LIBRARY_AUTOLOAD_DIRECTORY, NiFiProperties.DEFAULT_NAR_LIBRARY_AUTOLOAD_DIR)))
+                    .conflictResolutionStrategy(props.getProperty(NAR_PROVIDER_CONFLICT_RESOLUTION, DEFAULT_NAR_PROVIDER_CONFLICT_RESOLUTION))
+                    .pollInterval(props.getProperty(NAR_PROVIDER_POLL_INTERVAL_PROPERTY, DEFAULT_NAR_PROVIDER_POLL_INTERVAL))
+                    .restrainingStartup(Boolean.getBoolean(props.getProperty(NAR_PROVIDER_RESTRAIN_PROPERTY, "true")))
+                    .build();
+            narProviderService.start();
+
             // start the server
             server.start();
 
@@ -1097,17 +1141,6 @@ public class JettyServer implements NiFiServer, ExtensionUiLoader {
                 }
             }
 
-            final NarLoader narLoader = new StandardNarLoader(
-                    props.getExtensionsWorkingDirectory(),
-                    props.getComponentDocumentationWorkingDirectory(),
-                    NarClassLoadersHolder.getInstance(),
-                    extensionManager,
-                    extensionMapping,
-                    this);
-
-            narAutoLoader = new NarAutoLoader(props, narLoader, extensionManager);
-            narAutoLoader.start();
-
             // dump the application url after confirming everything started successfully
             dumpUrls();
         } catch (Exception ex) {
@@ -1115,6 +1148,51 @@ public class JettyServer implements NiFiServer, ExtensionUiLoader {
         }
     }
 
+    public Map<String, ExternalResourceProvider> buildExternalResourceProviders(
+            final ExtensionManager extensionManager,
+            final String providerPropertyPrefix,
+            final Predicate<ExternalResourceDescriptor> filter
+    ) throws ClassNotFoundException, InstantiationException, IllegalAccessException, TlsException {
+        final Map<String, ExternalResourceProvider> result = new HashMap<>();
+        final Set<String> externalSourceNames = props.getDirectSubsequentTokens(providerPropertyPrefix);
+
+        for(final String externalSourceName : externalSourceNames) {
+            logger.info("External resource provider \'{}\' found in configuration", externalSourceName);
+
+            final String providerClass = props.getProperty(providerPropertyPrefix + externalSourceName + "." + NAR_PROVIDER_IMPLEMENTATION_PROPERTY);
+            final String providerId = UUID.randomUUID().toString();
+
+            final ExternalResourceProviderInitializationContext context
+                    = new PropertyBasedExternalResourceProviderInitializationContext(props, providerPropertyPrefix + externalSourceName + ".", filter);
+            result.put(providerId, createProviderInstance(extensionManager, providerClass, providerId, context));
+        }
+
+        return result;
+    }
+
+    /**
+     * In case the provider class is not an implementation of {@code ExternalResourceProvider} the method tries to instantiate it as a {@code NarProvider}. {@code NarProvider} instances
+     * are wrapped into an adapter in order to envelope the support.
+     */
+    private ExternalResourceProvider createProviderInstance(
+            final ExtensionManager extensionManager,
+            final String providerClass,
+            final String providerId,
+            final ExternalResourceProviderInitializationContext context
+    ) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
+        ExternalResourceProvider provider;
+
+        try {
+            provider = NarThreadContextClassLoader.createInstance(extensionManager, providerClass, ExternalResourceProvider.class, props, providerId);
+        } catch (final ClassCastException e) {
+            logger.warn("Class {} does not implement \"ExternalResourceProvider\" falling back to \"NarProvider\"");
+            provider = new NarProviderAdapter(NarThreadContextClassLoader.createInstance(extensionManager, providerClass, NarProvider.class, props, providerId));
+        }
+
+        provider.initialize(context);
+        return provider;
+    }
+
     @Override
     public DiagnosticsFactory getDiagnosticsFactory() {
         // The diagnosticsFactory is initialized during server startup. If the diagnostics factory happens to be
@@ -1248,6 +1326,15 @@ public class JettyServer implements NiFiServer, ExtensionUiLoader {
         } catch (Exception e) {
             logger.warn("Failed to stop NAR auto-loader", e);
         }
+
+        try {
+            if (narProviderService != null) {
+                narProviderService.stop();
+            }
+        } catch (Exception e) {
+            logger.warn("Failed to stop NAR provider", e);
+        }
+
     }
 
     /**
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-server-nar/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-server-nar/pom.xml
index 227a7aa1f9..ce778c77c0 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-server-nar/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-server-nar/pom.xml
@@ -42,7 +42,6 @@
             <artifactId>nifi-framework-nar-loading-utils</artifactId>
             <version>1.17.0-SNAPSHOT</version>
         </dependency>
-
         <!-- Dependencies provided by nifi-framework-nar -->
         <dependency>
             <groupId>org.apache.nifi</groupId>
diff --git a/nifi-nar-bundles/nifi-framework-bundle/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/pom.xml
index 5d50470ee2..62d95da343 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/pom.xml
@@ -31,6 +31,7 @@
         <module>nifi-framework-nar</module>
         <module>nifi-server-nar</module>
         <module>nifi-headless-server-nar</module>
+        <module>nifi-framework-external-resource-utils</module>
     </modules>
     <dependencyManagement>
         <dependencies>
@@ -75,6 +76,11 @@
                 <artifactId>nifi-web-utils</artifactId>
                 <version>1.17.0-SNAPSHOT</version>
             </dependency>
+            <dependency>
+                <groupId>org.apache.nifi</groupId>
+                <artifactId>nifi-framework-external-resource-utils</artifactId>
+                <version>1.17.0-SNAPSHOT</version>
+            </dependency>
             <dependency>
                 <groupId>org.apache.nifi</groupId>
                 <artifactId>nifi-site-to-site-client</artifactId>
diff --git a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/pom.xml b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/pom.xml
index 077a72fd6b..9598497c26 100644
--- a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/pom.xml
+++ b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/pom.xml
@@ -140,6 +140,12 @@
             <artifactId>nifi-record</artifactId>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.nifi</groupId>
+            <artifactId>nifi-external-resource-utils</artifactId>
+            <version>1.17.0-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
 
     <build>
diff --git a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/nar/hadoop/HDFSNarProvider.java b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/flow/resource/hadoop/HDFSExternalResourceProvider.java
similarity index 79%
copy from nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/nar/hadoop/HDFSNarProvider.java
copy to nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/flow/resource/hadoop/HDFSExternalResourceProvider.java
index 06714d66a1..901e2cdaca 100644
--- a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/nar/hadoop/HDFSNarProvider.java
+++ b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/flow/resource/hadoop/HDFSExternalResourceProvider.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.nifi.nar.hadoop;
+package org.apache.nifi.flow.resource.hadoop;
 
 import org.apache.commons.io.IOUtils;
 import org.apache.hadoop.conf.Configuration;
@@ -25,10 +25,11 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.net.NetUtils;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.nifi.annotation.behavior.RequiresInstanceClassLoading;
+import org.apache.nifi.flow.resource.ExternalResourceDescriptor;
+import org.apache.nifi.flow.resource.ExternalResourceProvider;
+import org.apache.nifi.flow.resource.ExternalResourceProviderInitializationContext;
+import org.apache.nifi.flow.resource.ImmutableExternalResourceDescriptor;
 import org.apache.nifi.hadoop.SecurityUtil;
-import org.apache.nifi.nar.NarProvider;
-import org.apache.nifi.nar.NarProviderInitializationContext;
-import org.apache.nifi.nar.hadoop.util.ExtensionFilter;
 import org.apache.nifi.processors.hadoop.ExtendedConfiguration;
 import org.apache.nifi.processors.hadoop.HdfsResources;
 import org.apache.nifi.security.krb.KerberosKeytabUser;
@@ -51,8 +52,8 @@ import java.util.Objects;
 import java.util.stream.Collectors;
 
 @RequiresInstanceClassLoading(cloneAncestorResources = true)
-public class HDFSNarProvider implements NarProvider {
-    private static final Logger LOGGER = LoggerFactory.getLogger(HDFSNarProvider.class);
+public class HDFSExternalResourceProvider implements ExternalResourceProvider {
+    private static final Logger LOGGER = LoggerFactory.getLogger(HDFSExternalResourceProvider.class);
 
     private static final String RESOURCES_PARAMETER = "resources";
     private static final String SOURCE_DIRECTORY_PARAMETER = "source.directory";
@@ -60,22 +61,20 @@ public class HDFSNarProvider implements NarProvider {
     private static final String KERBEROS_PRINCIPAL_PARAMETER = "kerberos.principal";
     private static final String KERBEROS_KEYTAB_PARAMETER = "kerberos.keytab";
     private static final String KERBEROS_PASSWORD_PARAMETER = "kerberos.password";
-
-    private static final String NAR_EXTENSION = "nar";
-    private static final String DELIMITER = "/";
-    private static final int BUFFER_SIZE_DEFAULT = 4096;
     private static final Object RESOURCES_LOCK = new Object();
     private static final String STORAGE_LOCATION_PROPERTY = "fs.defaultFS";
+    private static final int BUFFER_SIZE_DEFAULT = 4096;
+    private static final String DELIMITER = "/";
 
     private volatile List<String> resources = null;
     private volatile Path sourceDirectory = null;
     private volatile String storageLocation = null;
 
-    private volatile NarProviderInitializationContext context;
-
+    private volatile ExternalResourceProviderInitializationContext context;
     private volatile boolean initialized = false;
 
-    public void initialize(final NarProviderInitializationContext context) {
+    @Override
+    public void initialize(final ExternalResourceProviderInitializationContext context) {
         resources = Arrays.stream(Objects.requireNonNull(
                 context.getProperties().get(RESOURCES_PARAMETER)).split(",")).map(s -> s.trim()).filter(s -> !s.isEmpty()).collect(Collectors.toList());
 
@@ -97,57 +96,64 @@ public class HDFSNarProvider implements NarProvider {
     }
 
     @Override
-    public Collection<String> listNars() throws IOException {
+    public Collection<ExternalResourceDescriptor> listResources() throws IOException {
         if (!initialized) {
-            LOGGER.error("Provider is not initialized");
+            throw new IllegalStateException("Provider is not initialized");
         }
 
         final HdfsResources hdfsResources = getHdfsResources();
 
         try {
+
             final FileStatus[] fileStatuses = hdfsResources.getUserGroupInformation()
-                .doAs((PrivilegedExceptionAction<FileStatus[]>) () -> hdfsResources.getFileSystem().listStatus(sourceDirectory, new ExtensionFilter(NAR_EXTENSION)));
+                    .doAs((PrivilegedExceptionAction<FileStatus[]>) () -> hdfsResources.getFileSystem().listStatus(sourceDirectory));
 
-            final List<String> result = Arrays.stream(fileStatuses)
-                .filter(fileStatus -> fileStatus.isFile())
-                .map(fileStatus -> fileStatus.getPath().getName())
-                .collect(Collectors.toList());
+            final List<ExternalResourceDescriptor> result = Arrays.stream(fileStatuses)
+                    .filter(fileStatus -> fileStatus.isFile())
+                    .map(HDFSExternalResourceProvider::convertStatusToDescriptor)
+                    .filter(context.getFilter())
+                    .collect(Collectors.toList());
 
             if (LOGGER.isDebugEnabled()) {
-                LOGGER.debug("The following NARs were found: " + String.join(", ", result));
+                LOGGER.debug("The following NARs were found: " + String.join(", ", result.stream().map(d -> d.getLocation()).collect(Collectors.toList())));
             }
 
             return result;
         } catch (final InterruptedException e) {
             Thread.currentThread().interrupt();
-            throw new IOException("Provider cannot list NARs", e);
+            throw new IOException("Provider cannot list resources", e);
         }
     }
 
+    private static ExternalResourceDescriptor convertStatusToDescriptor(final FileStatus fileStatus) {
+        return new ImmutableExternalResourceDescriptor(fileStatus.getPath().getName(), fileStatus.getModificationTime());
+    }
+
     @Override
-    public InputStream fetchNarContents(final String location) throws IOException {
+    public InputStream fetchExternalResource(final ExternalResourceDescriptor descriptor) throws IOException {
         if (!initialized) {
-            LOGGER.error("Provider is not initialized");
+            throw new IllegalStateException("Provider is not initialized");
         }
 
-
-        final Path path = getNarLocation(location);
+        final String location = descriptor.getLocation();
+        final Path path = getLocation(location);
         final HdfsResources hdfsResources = getHdfsResources();
 
         try {
-            if (hdfsResources.getUserGroupInformation().doAs((PrivilegedExceptionAction<Boolean>) () -> !hdfsResources.getFileSystem().exists(path))) {
-                throw new IOException("Provider cannot find " + location);
-            }
+            return hdfsResources.getUserGroupInformation().doAs((PrivilegedExceptionAction<FSDataInputStream>) () -> {
+                if (!hdfsResources.getFileSystem().exists(path)) {
+                    throw new IOException("Cannot find file in HDFS at location " + location);
+                }
 
-            return hdfsResources.getUserGroupInformation()
-                .doAs((PrivilegedExceptionAction<FSDataInputStream>) () -> hdfsResources.getFileSystem().open(path, BUFFER_SIZE_DEFAULT));
+                return hdfsResources.getFileSystem().open(path, BUFFER_SIZE_DEFAULT);
+            });
         } catch (final InterruptedException e) {
             Thread.currentThread().interrupt();
             throw new IOException("Error during acquiring file", e);
         }
     }
 
-    private Path getNarLocation(final String location) {
+    private Path getLocation(final String location) {
         String result = sourceDirectory.toString();
 
         if (!result.endsWith(DELIMITER)) {
@@ -207,6 +213,7 @@ public class HDFSNarProvider implements NarProvider {
 
             fs = getFileSystemAsUser(config, ugi);
         }
+
         LOGGER.debug("resetHDFSResources UGI [{}], KerberosUser [{}]", new Object[]{ugi, kerberosUser});
 
         final Path workingDir = fs.getWorkingDirectory();
diff --git a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/nar/hadoop/HDFSNarProvider.java b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/nar/hadoop/HDFSNarProvider.java
index 06714d66a1..c873a75718 100644
--- a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/nar/hadoop/HDFSNarProvider.java
+++ b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/nar/hadoop/HDFSNarProvider.java
@@ -16,241 +16,37 @@
  */
 package org.apache.nifi.nar.hadoop;
 
-import org.apache.commons.io.IOUtils;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.FSDataInputStream;
-import org.apache.hadoop.fs.FileStatus;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.net.NetUtils;
-import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.nifi.annotation.behavior.RequiresInstanceClassLoading;
-import org.apache.nifi.hadoop.SecurityUtil;
+import org.apache.nifi.flow.resource.ImmutableExternalResourceDescriptor;
+import org.apache.nifi.flow.resource.NarProviderAdapterInitializationContext;
+import org.apache.nifi.flow.resource.hadoop.HDFSExternalResourceProvider;
 import org.apache.nifi.nar.NarProvider;
 import org.apache.nifi.nar.NarProviderInitializationContext;
-import org.apache.nifi.nar.hadoop.util.ExtensionFilter;
-import org.apache.nifi.processors.hadoop.ExtendedConfiguration;
-import org.apache.nifi.processors.hadoop.HdfsResources;
-import org.apache.nifi.security.krb.KerberosKeytabUser;
-import org.apache.nifi.security.krb.KerberosPasswordUser;
-import org.apache.nifi.security.krb.KerberosUser;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
-import javax.net.SocketFactory;
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-import java.net.URI;
-import java.security.PrivilegedExceptionAction;
-import java.util.Arrays;
 import java.util.Collection;
-import java.util.List;
-import java.util.Objects;
 import java.util.stream.Collectors;
 
+@Deprecated
 @RequiresInstanceClassLoading(cloneAncestorResources = true)
-public class HDFSNarProvider implements NarProvider {
-    private static final Logger LOGGER = LoggerFactory.getLogger(HDFSNarProvider.class);
-
-    private static final String RESOURCES_PARAMETER = "resources";
-    private static final String SOURCE_DIRECTORY_PARAMETER = "source.directory";
-    private static final String STORAGE_LOCATION = "storage.location";
-    private static final String KERBEROS_PRINCIPAL_PARAMETER = "kerberos.principal";
-    private static final String KERBEROS_KEYTAB_PARAMETER = "kerberos.keytab";
-    private static final String KERBEROS_PASSWORD_PARAMETER = "kerberos.password";
-
-    private static final String NAR_EXTENSION = "nar";
-    private static final String DELIMITER = "/";
-    private static final int BUFFER_SIZE_DEFAULT = 4096;
-    private static final Object RESOURCES_LOCK = new Object();
-    private static final String STORAGE_LOCATION_PROPERTY = "fs.defaultFS";
-
-    private volatile List<String> resources = null;
-    private volatile Path sourceDirectory = null;
-    private volatile String storageLocation = null;
-
-    private volatile NarProviderInitializationContext context;
-
-    private volatile boolean initialized = false;
+public class HDFSNarProvider extends HDFSExternalResourceProvider implements NarProvider {
 
+    @Override
     public void initialize(final NarProviderInitializationContext context) {
-        resources = Arrays.stream(Objects.requireNonNull(
-                context.getProperties().get(RESOURCES_PARAMETER)).split(",")).map(s -> s.trim()).filter(s -> !s.isEmpty()).collect(Collectors.toList());
-
-        if (resources.isEmpty()) {
-            throw new IllegalArgumentException("At least one HDFS configuration resource is necessary");
-        }
-
-        final String sourceDirectory = context.getProperties().get(SOURCE_DIRECTORY_PARAMETER);
-
-        if (sourceDirectory == null || sourceDirectory.isEmpty()) {
-            throw new IllegalArgumentException("Provider needs the source directory to be set");
-        }
-
-        this.sourceDirectory = new Path(sourceDirectory);
-        this.storageLocation = context.getProperties().get(STORAGE_LOCATION);
-
-        this.context = context;
-        this.initialized = true;
+        initialize(new NarProviderAdapterInitializationContext(context));
     }
 
     @Override
     public Collection<String> listNars() throws IOException {
-        if (!initialized) {
-            LOGGER.error("Provider is not initialized");
-        }
-
-        final HdfsResources hdfsResources = getHdfsResources();
-
-        try {
-            final FileStatus[] fileStatuses = hdfsResources.getUserGroupInformation()
-                .doAs((PrivilegedExceptionAction<FileStatus[]>) () -> hdfsResources.getFileSystem().listStatus(sourceDirectory, new ExtensionFilter(NAR_EXTENSION)));
-
-            final List<String> result = Arrays.stream(fileStatuses)
-                .filter(fileStatus -> fileStatus.isFile())
-                .map(fileStatus -> fileStatus.getPath().getName())
-                .collect(Collectors.toList());
-
-            if (LOGGER.isDebugEnabled()) {
-                LOGGER.debug("The following NARs were found: " + String.join(", ", result));
-            }
-
-            return result;
-        } catch (final InterruptedException e) {
-            Thread.currentThread().interrupt();
-            throw new IOException("Provider cannot list NARs", e);
-        }
+        // Only NARs will be listed due to the filter in {@code HDFSNarProviderInitializationContext}
+        return listResources().stream().map(d -> d.getLocation()).collect(Collectors.toList());
     }
 
     @Override
     public InputStream fetchNarContents(final String location) throws IOException {
-        if (!initialized) {
-            LOGGER.error("Provider is not initialized");
-        }
-
-
-        final Path path = getNarLocation(location);
-        final HdfsResources hdfsResources = getHdfsResources();
-
-        try {
-            if (hdfsResources.getUserGroupInformation().doAs((PrivilegedExceptionAction<Boolean>) () -> !hdfsResources.getFileSystem().exists(path))) {
-                throw new IOException("Provider cannot find " + location);
-            }
-
-            return hdfsResources.getUserGroupInformation()
-                .doAs((PrivilegedExceptionAction<FSDataInputStream>) () -> hdfsResources.getFileSystem().open(path, BUFFER_SIZE_DEFAULT));
-        } catch (final InterruptedException e) {
-            Thread.currentThread().interrupt();
-            throw new IOException("Error during acquiring file", e);
-        }
-    }
-
-    private Path getNarLocation(final String location) {
-        String result = sourceDirectory.toString();
-
-        if (!result.endsWith(DELIMITER)) {
-            result += DELIMITER;
-        }
-
-        return new Path(result + location);
-    }
-
-    private HdfsResources getHdfsResources() throws IOException {
-        final Configuration config = new ExtendedConfiguration(LOGGER);
-        config.setClassLoader(Thread.currentThread().getContextClassLoader());
-
-        for (final String resource : resources) {
-            config.addResource(new Path(resource));
-        }
-
-        // If storage location property is set, the original location will be overwritten
-        if (storageLocation != null) {
-            config.set(STORAGE_LOCATION_PROPERTY, storageLocation);
-        }
-
-        // first check for timeout on HDFS connection, because FileSystem has a hard coded 15 minute timeout
-        checkHdfsUriForTimeout(config);
-
-        // disable caching of Configuration and FileSystem objects, else we cannot reconfigure the processor without a complete restart
-        final String disableCacheName = String.format("fs.%s.impl.disable.cache", FileSystem.getDefaultUri(config).getScheme());
-        config.set(disableCacheName, "true");
-
-        // If kerberos is enabled, create the file system as the kerberos principal
-        // -- use RESOURCE_LOCK to guarantee UserGroupInformation is accessed by only a single thread at at time
-        FileSystem fs;
-        UserGroupInformation ugi;
-        KerberosUser kerberosUser;
-
-        synchronized (RESOURCES_LOCK) {
-            if (SecurityUtil.isSecurityEnabled(config)) {
-                final String principal = context.getProperties().get(KERBEROS_PRINCIPAL_PARAMETER);
-                final String keyTab = context.getProperties().get(KERBEROS_KEYTAB_PARAMETER);
-                final String password = context.getProperties().get(KERBEROS_PASSWORD_PARAMETER);
-
-                if (keyTab != null) {
-                    kerberosUser = new KerberosKeytabUser(principal, keyTab);
-                } else if (password != null) {
-                    kerberosUser = new KerberosPasswordUser(principal, password);
-                } else {
-                    throw new IOException("Unable to authenticate with Kerberos, no keytab or password was provided");
-                }
-
-                ugi = SecurityUtil.getUgiForKerberosUser(config, kerberosUser);
-            } else {
-                config.set("ipc.client.fallback-to-simple-auth-allowed", "true");
-                config.set("hadoop.security.authentication", "simple");
-                ugi = SecurityUtil.loginSimple(config);
-                kerberosUser = null;
-            }
-
-            fs = getFileSystemAsUser(config, ugi);
-        }
-        LOGGER.debug("resetHDFSResources UGI [{}], KerberosUser [{}]", new Object[]{ugi, kerberosUser});
-
-        final Path workingDir = fs.getWorkingDirectory();
-        LOGGER.debug("Initialized a new HDFS File System with working dir: {} default block size: {} default replication: {} config: {}",
-                new Object[]{workingDir, fs.getDefaultBlockSize(workingDir), fs.getDefaultReplication(workingDir), config.toString()});
-
-        if (!fs.exists(sourceDirectory)) {
-            throw new IllegalArgumentException("Source directory is not existing");
-        }
-
-        return new HdfsResources(config, fs, ugi, kerberosUser);
+        // Nar provider does not support modification time based fetch
+        return fetchExternalResource(new ImmutableExternalResourceDescriptor(location, System.currentTimeMillis()));
     }
 
-    private void checkHdfsUriForTimeout(final Configuration config) throws IOException {
-        final URI hdfsUri = FileSystem.getDefaultUri(config);
-        final String address = hdfsUri.getAuthority();
-        final int port = hdfsUri.getPort();
-
-        if (address == null || address.isEmpty() || port < 0) {
-            return;
-        }
-
-        final InetSocketAddress namenode = NetUtils.createSocketAddr(address, port);
-        final SocketFactory socketFactory = NetUtils.getDefaultSocketFactory(config);
-        Socket socket = null;
-
-        try {
-            socket = socketFactory.createSocket();
-            NetUtils.connect(socket, namenode, 1000); // 1 second timeout
-        } finally {
-            IOUtils.closeQuietly(socket);
-        }
-    }
-
-    private FileSystem getFileSystemAsUser(final Configuration config, final UserGroupInformation ugi) throws IOException {
-        try {
-            return ugi.doAs(new PrivilegedExceptionAction<FileSystem>() {
-                @Override
-                public FileSystem run() throws Exception {
-                    return FileSystem.get(config);
-                }
-            });
-        } catch (final InterruptedException e) {
-            throw new IOException("Unable to create file system: " + e.getMessage(), e);
-        }
-    }
 }
diff --git a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/resources/META-INF/services/org.apache.nifi.flow.resource.ExternalResourceProvider b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/resources/META-INF/services/org.apache.nifi.flow.resource.ExternalResourceProvider
new file mode 100644
index 0000000000..3eab5c46d1
--- /dev/null
+++ b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/resources/META-INF/services/org.apache.nifi.flow.resource.ExternalResourceProvider
@@ -0,0 +1,15 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+org.apache.nifi.flow.resource.hadoop.HDFSExternalResourceProvider