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 e7c6bda  NIFI-7937 Added StandardFlowFileMediaType enum to replace 
string references to FlowFile Media Types
e7c6bda is described below

commit e7c6bdad42514200d8732b644c59dcb789e358da
Author: exceptionfactory <[email protected]>
AuthorDate: Sat Oct 17 12:25:00 2020 -0400

    NIFI-7937 Added StandardFlowFileMediaType enum to replace string references 
to FlowFile Media Types
---
 .../flowfile/attributes/FlowFileMediaType.java     | 29 +++++++++++++++
 .../attributes/StandardFlowFileMediaType.java      | 41 ++++++++++++++++++++++
 .../hadoop/CreateHadoopSequenceFile.java           | 30 ++++++++--------
 .../hadoop/TestCreateHadoopSequenceFile.java       |  3 +-
 .../nifi/processors/standard/MergeContent.java     |  7 ++--
 .../apache/nifi/processors/standard/PostHTTP.java  | 22 ++++++------
 .../nifi/processors/standard/UnpackContent.java    |  7 ++--
 .../standard/servlets/ListenHTTPServlet.java       | 16 +++++----
 .../nifi/processors/standard/CaptureServlet.java   |  5 ++-
 .../processors/standard/TestIdentifyMimeType.java  |  5 +--
 .../nifi/processors/standard/TestMergeContent.java |  3 +-
 11 files changed, 125 insertions(+), 43 deletions(-)

diff --git 
a/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/flowfile/attributes/FlowFileMediaType.java
 
b/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/flowfile/attributes/FlowFileMediaType.java
new file mode 100644
index 0000000..49009ef
--- /dev/null
+++ 
b/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/flowfile/attributes/FlowFileMediaType.java
@@ -0,0 +1,29 @@
+/*
+ * 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.flowfile.attributes;
+
+/**
+ * Flow File Media Type Definition
+ */
+public interface FlowFileMediaType {
+    /**
+     * Get Media Type Definition with type and subtype components
+     *
+     * @return Media Type Definition
+     */
+    String getMediaType();
+}
diff --git 
a/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/flowfile/attributes/StandardFlowFileMediaType.java
 
b/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/flowfile/attributes/StandardFlowFileMediaType.java
new file mode 100644
index 0000000..c4cd87b
--- /dev/null
+++ 
b/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/flowfile/attributes/StandardFlowFileMediaType.java
@@ -0,0 +1,41 @@
+/*
+ * 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.flowfile.attributes;
+
+/**
+ * Enumeration of standard Flow File Media Types
+ */
+public enum StandardFlowFileMediaType implements FlowFileMediaType {
+    VERSION_1("application/flowfile-v1"),
+
+    VERSION_2("application/flowfile-v2"),
+
+    VERSION_3("application/flowfile-v3"),
+
+    VERSION_UNSPECIFIED("application/flowfile");
+
+    private String mediaType;
+
+    StandardFlowFileMediaType(final String mediaType) {
+        this.mediaType = mediaType;
+    }
+
+    @Override
+    public String getMediaType() {
+        return mediaType;
+    }
+}
diff --git 
a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/CreateHadoopSequenceFile.java
 
b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/CreateHadoopSequenceFile.java
index dc7af65..011bf31 100644
--- 
a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/CreateHadoopSequenceFile.java
+++ 
b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/CreateHadoopSequenceFile.java
@@ -28,6 +28,7 @@ import org.apache.nifi.annotation.documentation.Tags;
 import org.apache.nifi.components.PropertyDescriptor;
 import org.apache.nifi.flowfile.FlowFile;
 import org.apache.nifi.flowfile.attributes.CoreAttributes;
+import org.apache.nifi.flowfile.attributes.StandardFlowFileMediaType;
 import org.apache.nifi.processor.ProcessContext;
 import org.apache.nifi.processor.ProcessSession;
 import org.apache.nifi.processor.Relationship;
@@ -125,20 +126,21 @@ public class CreateHadoopSequenceFile extends 
AbstractHadoopProcessor {
         String mimeType = 
flowFile.getAttribute(CoreAttributes.MIME_TYPE.key());
         String packagingFormat = NOT_PACKAGED;
         if (null != mimeType) {
-            switch (mimeType.toLowerCase()) {
-                case "application/tar":
-                    packagingFormat = TAR_FORMAT;
-                    break;
-                case "application/zip":
-                    packagingFormat = ZIP_FORMAT;
-                    break;
-                case "application/flowfile-v3":
-                    packagingFormat = FLOWFILE_STREAM_FORMAT_V3;
-                    break;
-                default:
-                    getLogger().warn(
-                            "Cannot unpack {} because its mime.type attribute 
is set to '{}', which is not a format that can be unpacked",
-                            new Object[]{flowFile, mimeType});
+            if 
(StandardFlowFileMediaType.VERSION_3.getMediaType().equals(mimeType)) {
+                packagingFormat = FLOWFILE_STREAM_FORMAT_V3;
+            } else {
+                switch (mimeType.toLowerCase()) {
+                    case "application/tar":
+                        packagingFormat = TAR_FORMAT;
+                        break;
+                    case "application/zip":
+                        packagingFormat = ZIP_FORMAT;
+                        break;
+                    default:
+                        getLogger().warn(
+                                "Cannot unpack {} because its mime.type 
attribute is set to '{}', which is not a format that can be unpacked",
+                                new Object[]{flowFile, mimeType});
+                }
             }
         }
         final SequenceFileWriter sequenceFileWriter;
diff --git 
a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/TestCreateHadoopSequenceFile.java
 
b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/TestCreateHadoopSequenceFile.java
index bbb050a..0124352 100644
--- 
a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/TestCreateHadoopSequenceFile.java
+++ 
b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/TestCreateHadoopSequenceFile.java
@@ -24,6 +24,7 @@ import org.apache.hadoop.io.compress.DefaultCodec;
 import org.apache.nifi.components.AllowableValue;
 import org.apache.nifi.components.PropertyDescriptor;
 import org.apache.nifi.flowfile.attributes.CoreAttributes;
+import org.apache.nifi.flowfile.attributes.StandardFlowFileMediaType;
 import org.apache.nifi.hadoop.KerberosProperties;
 import org.apache.nifi.util.MockFlowFile;
 import org.apache.nifi.util.NiFiProperties;
@@ -183,7 +184,7 @@ public class TestCreateHadoopSequenceFile {
     @Test
     public void testMergedFlowfilePackagedData() throws IOException {
         Map<String, String> attributes = new HashMap<>();
-        attributes.put(CoreAttributes.MIME_TYPE.key(), 
"application/flowfile-v3");
+        attributes.put(CoreAttributes.MIME_TYPE.key(), 
StandardFlowFileMediaType.VERSION_3.getMediaType());
         try ( final FileInputStream fin = new 
FileInputStream("src/test/resources/testdata/13545479542069498.pkg")) {
             controller.enqueue(fin, attributes);
 
diff --git 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/MergeContent.java
 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/MergeContent.java
index dfe60e1..4bb9d4d 100644
--- 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/MergeContent.java
+++ 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/MergeContent.java
@@ -75,6 +75,7 @@ import org.apache.nifi.expression.ExpressionLanguageScope;
 import org.apache.nifi.flowfile.FlowFile;
 import org.apache.nifi.flowfile.attributes.CoreAttributes;
 import org.apache.nifi.flowfile.attributes.FragmentAttributes;
+import org.apache.nifi.flowfile.attributes.StandardFlowFileMediaType;
 import org.apache.nifi.processor.ProcessContext;
 import org.apache.nifi.processor.ProcessSession;
 import org.apache.nifi.processor.Relationship;
@@ -467,13 +468,13 @@ public class MergeContent extends BinFiles {
                 merger = new 
ZipMerge(context.getProperty(COMPRESSION_LEVEL).asInteger());
                 break;
             case MERGE_FORMAT_FLOWFILE_STREAM_V3_VALUE:
-                merger = new FlowFileStreamMerger(new FlowFilePackagerV3(), 
"application/flowfile-v3");
+                merger = new FlowFileStreamMerger(new FlowFilePackagerV3(), 
StandardFlowFileMediaType.VERSION_3.getMediaType());
                 break;
             case MERGE_FORMAT_FLOWFILE_STREAM_V2_VALUE:
-                merger = new FlowFileStreamMerger(new FlowFilePackagerV2(), 
"application/flowfile-v2");
+                merger = new FlowFileStreamMerger(new FlowFilePackagerV2(), 
StandardFlowFileMediaType.VERSION_2.getMediaType());
                 break;
             case MERGE_FORMAT_FLOWFILE_TAR_V1_VALUE:
-                merger = new FlowFileStreamMerger(new FlowFilePackagerV1(), 
"application/flowfile-v1");
+                merger = new FlowFileStreamMerger(new FlowFilePackagerV1(), 
StandardFlowFileMediaType.VERSION_1.getMediaType());
                 break;
             case MERGE_FORMAT_CONCAT_VALUE:
                 merger = new BinaryConcatenationMerge();
diff --git 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PostHTTP.java
 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PostHTTP.java
index 38e5ccc..ac47f0c 100644
--- 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PostHTTP.java
+++ 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PostHTTP.java
@@ -108,6 +108,7 @@ import org.apache.nifi.components.ValidationResult;
 import org.apache.nifi.expression.ExpressionLanguageScope;
 import org.apache.nifi.flowfile.FlowFile;
 import org.apache.nifi.flowfile.attributes.CoreAttributes;
+import org.apache.nifi.flowfile.attributes.StandardFlowFileMediaType;
 import org.apache.nifi.logging.ComponentLog;
 import org.apache.nifi.processor.AbstractProcessor;
 import org.apache.nifi.processor.DataUnit;
@@ -148,9 +149,6 @@ public class PostHTTP extends AbstractProcessor {
     public static final String CONTENT_TYPE_HEADER = "Content-Type";
     public static final String ACCEPT = "Accept";
     public static final String ACCEPT_ENCODING = "Accept-Encoding";
-    public static final String APPLICATION_FLOW_FILE_V1 = 
"application/flowfile";
-    public static final String APPLICATION_FLOW_FILE_V2 = 
"application/flowfile-v2";
-    public static final String APPLICATION_FLOW_FILE_V3 = 
"application/flowfile-v3";
     public static final String DEFAULT_CONTENT_TYPE = 
"application/octet-stream";
     public static final String FLOWFILE_CONFIRMATION_HEADER = 
"x-prefer-acknowledge-uri";
     public static final String LOCATION_HEADER_NAME = "Location";
@@ -165,6 +163,8 @@ public class PostHTTP extends AbstractProcessor {
     public static final String PROTOCOL_VERSION = "3";
     public static final String REMOTE_DN = "remote.dn";
 
+    private static final String FLOW_FILE_CONNECTION_LOG = "Connection to URI 
{} will be using Content Type {} if sending data as FlowFile";
+
     public static final PropertyDescriptor URL = new 
PropertyDescriptor.Builder()
             .name("URL")
             .description("The URL to POST to. The URL may be defined using the 
Attribute Expression Language. "
@@ -709,11 +709,11 @@ public class PostHTTP extends AbstractProcessor {
         final String contentType;
         if (sendAsFlowFile) {
             if (accepts.isFlowFileV3Accepted()) {
-                contentType = APPLICATION_FLOW_FILE_V3;
+                contentType = 
StandardFlowFileMediaType.VERSION_3.getMediaType();
             } else if (accepts.isFlowFileV2Accepted()) {
-                contentType = APPLICATION_FLOW_FILE_V2;
+                contentType = 
StandardFlowFileMediaType.VERSION_2.getMediaType();
             } else if (accepts.isFlowFileV1Accepted()) {
-                contentType = APPLICATION_FLOW_FILE_V1;
+                contentType = 
StandardFlowFileMediaType.VERSION_1.getMediaType();
             } else {
                 logger.error("Cannot send {} to {} because the destination 
does not accept FlowFiles and this processor is "
                         + "configured to deliver FlowFiles; routing to 
failure",
@@ -942,9 +942,9 @@ public class PostHTTP extends AbstractProcessor {
                     for (final Header header : headers) {
                         for (final String accepted : 
header.getValue().split(",")) {
                             final String trimmed = accepted.trim();
-                            if (trimmed.equals(APPLICATION_FLOW_FILE_V3)) {
+                            if 
(trimmed.equals(StandardFlowFileMediaType.VERSION_3.getMediaType())) {
                                 acceptsFlowFileV3 = true;
-                            } else if 
(trimmed.equals(APPLICATION_FLOW_FILE_V2)) {
+                            } else if 
(trimmed.equals(StandardFlowFileMediaType.VERSION_2.getMediaType())) {
                                 acceptsFlowFileV2 = true;
                             }
                         }
@@ -962,11 +962,11 @@ public class PostHTTP extends AbstractProcessor {
 
                 if (getLogger().isDebugEnabled()) {
                     if (acceptsFlowFileV3) {
-                        getLogger().debug("Connection to URI " + uri + " will 
be using Content Type " + APPLICATION_FLOW_FILE_V3 + " if sending data as 
FlowFile");
+                        getLogger().debug(FLOW_FILE_CONNECTION_LOG, new 
Object[]{uri, StandardFlowFileMediaType.VERSION_3.getMediaType()});
                     } else if (acceptsFlowFileV2) {
-                        getLogger().debug("Connection to URI " + uri + " will 
be using Content Type " + APPLICATION_FLOW_FILE_V2 + " if sending data as 
FlowFile");
+                        getLogger().debug(FLOW_FILE_CONNECTION_LOG, new 
Object[]{uri, StandardFlowFileMediaType.VERSION_2.getMediaType()});
                     } else if (acceptsFlowFileV1) {
-                        getLogger().debug("Connection to URI " + uri + " will 
be using Content Type " + APPLICATION_FLOW_FILE_V1 + " if sending data as 
FlowFile");
+                        getLogger().debug(FLOW_FILE_CONNECTION_LOG, new 
Object[]{uri, StandardFlowFileMediaType.VERSION_1.getMediaType()});
                     }
                 }
             }
diff --git 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/UnpackContent.java
 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/UnpackContent.java
index 1fc4e9f..4beaa1f 100644
--- 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/UnpackContent.java
+++ 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/UnpackContent.java
@@ -58,6 +58,7 @@ import org.apache.nifi.components.PropertyValue;
 import org.apache.nifi.flowfile.FlowFile;
 import org.apache.nifi.flowfile.attributes.CoreAttributes;
 import org.apache.nifi.flowfile.attributes.FragmentAttributes;
+import org.apache.nifi.flowfile.attributes.StandardFlowFileMediaType;
 import org.apache.nifi.logging.ComponentLog;
 import org.apache.nifi.processor.AbstractProcessor;
 import org.apache.nifi.processor.ProcessContext;
@@ -551,9 +552,9 @@ public class UnpackContent extends AbstractProcessor {
         TAR_FORMAT(TAR_FORMAT_NAME, "application/tar"),
         X_TAR_FORMAT(TAR_FORMAT_NAME, "application/x-tar"),
         ZIP_FORMAT(ZIP_FORMAT_NAME, "application/zip"),
-        FLOWFILE_STREAM_FORMAT_V3(FLOWFILE_STREAM_FORMAT_V3_NAME, 
"application/flowfile-v3"),
-        FLOWFILE_STREAM_FORMAT_V2(FLOWFILE_STREAM_FORMAT_V2_NAME, 
"application/flowfile-v2"),
-        FLOWFILE_TAR_FORMAT(FLOWFILE_TAR_FORMAT_NAME, 
"application/flowfile-v1");
+        FLOWFILE_STREAM_FORMAT_V3(FLOWFILE_STREAM_FORMAT_V3_NAME, 
StandardFlowFileMediaType.VERSION_3.getMediaType()),
+        FLOWFILE_STREAM_FORMAT_V2(FLOWFILE_STREAM_FORMAT_V2_NAME, 
StandardFlowFileMediaType.VERSION_2.getMediaType()),
+        FLOWFILE_TAR_FORMAT(FLOWFILE_TAR_FORMAT_NAME, 
StandardFlowFileMediaType.VERSION_1.getMediaType());
 
 
         private final String textValue;
diff --git 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/servlets/ListenHTTPServlet.java
 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/servlets/ListenHTTPServlet.java
index 9c65e66..f3e2756 100644
--- 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/servlets/ListenHTTPServlet.java
+++ 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/servlets/ListenHTTPServlet.java
@@ -22,6 +22,7 @@ import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.nifi.flowfile.FlowFile;
 import org.apache.nifi.flowfile.attributes.CoreAttributes;
+import org.apache.nifi.flowfile.attributes.StandardFlowFileMediaType;
 import org.apache.nifi.logging.ComponentLog;
 import org.apache.nifi.processor.ProcessContext;
 import org.apache.nifi.processor.ProcessSession;
@@ -76,14 +77,15 @@ public class ListenHTTPServlet extends HttpServlet {
     public static final String FLOWFILE_CONFIRMATION_HEADER = 
"x-prefer-acknowledge-uri";
     public static final String LOCATION_HEADER_NAME = "Location";
     public static final String DEFAULT_FOUND_SUBJECT = "none";
-    public static final String APPLICATION_FLOW_FILE_V1 = 
"application/flowfile";
-    public static final String APPLICATION_FLOW_FILE_V2 = 
"application/flowfile-v2";
-    public static final String APPLICATION_FLOW_FILE_V3 = 
"application/flowfile-v3";
     public static final String LOCATION_URI_INTENT_NAME = 
"x-location-uri-intent";
     public static final String LOCATION_URI_INTENT_VALUE = "flowfile-hold";
     public static final int FILES_BEFORE_CHECKING_DESTINATION_SPACE = 5;
     public static final String ACCEPT_HEADER_NAME = "Accept";
-    public static final String ACCEPT_HEADER_VALUE = APPLICATION_FLOW_FILE_V3 
+ "," + APPLICATION_FLOW_FILE_V2 + "," + APPLICATION_FLOW_FILE_V1 + 
",*/*;q=0.8";
+    public static final String ACCEPT_HEADER_VALUE = 
String.format("%s,%s,%s,%s,*/*;q=0.8",
+            StandardFlowFileMediaType.VERSION_3.getMediaType(),
+            StandardFlowFileMediaType.VERSION_2.getMediaType(),
+            StandardFlowFileMediaType.VERSION_1.getMediaType(),
+            StandardFlowFileMediaType.VERSION_UNSPECIFIED.getMediaType());
     public static final String ACCEPT_ENCODING_NAME = "Accept-Encoding";
     public static final String ACCEPT_ENCODING_VALUE = "gzip";
     public static final String GZIPPED_HEADER = "flowfile-gzipped";
@@ -271,11 +273,11 @@ public class ListenHTTPServlet extends HttpServlet {
         String holdUuid = null;
         final AtomicBoolean hasMoreData = new AtomicBoolean(false);
         final FlowFileUnpackager unpackager;
-        if (APPLICATION_FLOW_FILE_V3.equals(contentType)) {
+        if 
(StandardFlowFileMediaType.VERSION_3.getMediaType().equals(contentType)) {
             unpackager = new FlowFileUnpackagerV3();
-        } else if (APPLICATION_FLOW_FILE_V2.equals(contentType)) {
+        } else if 
(StandardFlowFileMediaType.VERSION_2.getMediaType().equals(contentType)) {
             unpackager = new FlowFileUnpackagerV2();
-        } else if (APPLICATION_FLOW_FILE_V1.equals(contentType)) {
+        } else if (StringUtils.startsWith(contentType, 
StandardFlowFileMediaType.VERSION_UNSPECIFIED.getMediaType())) {
             unpackager = new FlowFileUnpackagerV1();
         } else {
             unpackager = null;
diff --git 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/CaptureServlet.java
 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/CaptureServlet.java
index c2cca47..13feea9 100644
--- 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/CaptureServlet.java
+++ 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/CaptureServlet.java
@@ -26,6 +26,8 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.ws.rs.core.Response.Status;
+
+import org.apache.nifi.flowfile.attributes.StandardFlowFileMediaType;
 import org.apache.nifi.stream.io.StreamUtils;
 import org.apache.nifi.util.file.FileUtils;
 
@@ -67,7 +69,8 @@ public class CaptureServlet extends HttpServlet {
 
     @Override
     protected void doHead(final HttpServletRequest request, final 
HttpServletResponse response) throws ServletException, IOException {
-        response.setHeader("Accept", 
"application/flowfile-v3,application/flowfile-v2");
+        final String acceptHeader = String.format("%s,%s", 
StandardFlowFileMediaType.VERSION_3.getMediaType(), 
StandardFlowFileMediaType.VERSION_2.getMediaType());
+        response.setHeader("Accept", acceptHeader);
         response.setHeader("x-nifi-transfer-protocol-version", "1");
         // Unless an acceptGzip parameter is explicitly set to false, respond 
that this server accepts gzip
         if 
(!Boolean.toString(false).equalsIgnoreCase(request.getParameter("acceptGzip"))) 
{
diff --git 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestIdentifyMimeType.java
 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestIdentifyMimeType.java
index 71ede0b..c91d40c 100644
--- 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestIdentifyMimeType.java
+++ 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestIdentifyMimeType.java
@@ -26,6 +26,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.nifi.flowfile.attributes.CoreAttributes;
+import org.apache.nifi.flowfile.attributes.StandardFlowFileMediaType;
 import org.apache.nifi.util.MockFlowFile;
 import org.apache.nifi.util.TestRunner;
 import org.apache.nifi.util.TestRunners;
@@ -71,8 +72,8 @@ public class TestIdentifyMimeType {
         expectedMimeTypes.put("1.tar.gz", "application/gzip");
         expectedMimeTypes.put("1.jar", "application/java-archive");
         expectedMimeTypes.put("1.xml", "application/xml");
-        expectedMimeTypes.put("flowfilev3", "application/flowfile-v3");
-        expectedMimeTypes.put("flowfilev1.tar", "application/flowfile-v1");
+        expectedMimeTypes.put("flowfilev3", 
StandardFlowFileMediaType.VERSION_3.getMediaType());
+        expectedMimeTypes.put("flowfilev1.tar", 
StandardFlowFileMediaType.VERSION_1.getMediaType());
         expectedMimeTypes.put("fake.csv", "text/csv");
         expectedMimeTypes.put("2.custom", "text/plain");
 
diff --git 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestMergeContent.java
 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestMergeContent.java
index a4c5fc0..7a20e6d 100644
--- 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestMergeContent.java
+++ 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestMergeContent.java
@@ -31,6 +31,7 @@ import 
org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
 import org.apache.commons.io.IOUtils;
 import org.apache.nifi.components.ValidationResult;
 import org.apache.nifi.flowfile.attributes.CoreAttributes;
+import org.apache.nifi.flowfile.attributes.StandardFlowFileMediaType;
 import org.apache.nifi.processor.ProcessContext;
 import org.apache.nifi.processors.standard.merge.AttributeStrategyUtil;
 import org.apache.nifi.util.MockFlowFile;
@@ -839,7 +840,7 @@ public class TestMergeContent {
         runner.assertTransferCount(MergeContent.REL_ORIGINAL, 2);
 
         final MockFlowFile merged = 
runner.getFlowFilesForRelationship(MergeContent.REL_MERGED).get(0);
-        merged.assertAttributeEquals(CoreAttributes.MIME_TYPE.key(), 
"application/flowfile-v3");
+        merged.assertAttributeEquals(CoreAttributes.MIME_TYPE.key(), 
StandardFlowFileMediaType.VERSION_3.getMediaType());
     }
 
     @Test

Reply via email to