If you have the NiFi policy access to restricted components (requiring 'execute code'), there is a way to get the Groovy script processor working without admin-access to this NiFi-Server (presuming you are referring to the operating system level access).
Fortunately, the JARs needed by the Groovy script you reference are bundled with NiFi and flows have access to them by necessity. You should be able to get the processor to work by setting the Additional classpath property of the ExecuteGroovyScript processor to something like: ${nifi.nar.working.directory}/framework/nifi-framework-nar-1.11.4.nar-unpacked/NAR-INF/bundled-dependencies/httpcore-4.4.9.jar;${nifi.nar.working.directory}/extensions/nifi-slack-nar-1.11.4.nar-unpacked/NAR-INF/bundled-dependencies/httpmime-4.5.7.jar
.
Here, nifi.nar.working.directory
is a NiFi variable set to the same value as what it is in the nifi.properties file. NB: You will need to change the version information in this example if you are not using NiFi 1.11.4.
Explanation: the NiFi framework includes the class org.apache.http.entity.ContentType
. Several NiFi extensions include the class org.apache.http.entity.mime.MultipartEntityBuilder
: media (has the most recent JAR version, but is not currently bundled with the NiFi distribution); slack (has the next most recent JAR version); and solr.
Caveat: This approach is fragile because it will break during a NiFi upgrade. A way to guard against this is to have a NiFi flow that gets the two JAR files and puts them to a location that will be preserved during an upgrade. Then the Additional classpath property of the ExecuteGroovyScript processor would refer to this preserved location. (You would need the NiFi policy, access to restricted components (requiring 'write filesystem') to create this flow.)