EndzeitBegins commented on code in PR #8011:
URL: https://github.com/apache/nifi/pull/8011#discussion_r1393174739


##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/IdentifyMimeType.java:
##########
@@ -89,14 +89,17 @@
 @Tags({"compression", "gzip", "bzip2", "zip", "MIME", "mime.type", "file", 
"identify"})
 @CapabilityDescription("Attempts to identify the MIME Type used for a 
FlowFile. If the MIME Type can be identified, "
         + "an attribute with the name 'mime.type' is added with the value 
being the MIME Type. If the MIME Type cannot be determined, "
-        + "the value will be set to 'application/octet-stream'. In addition, 
the attribute mime.extension will be set if a common file "
-        + "extension for the MIME Type is known.")
+        + "the value will be set to 'application/octet-stream'. In addition, 
the attribute 'mime.extension' will be set if a common file "
+        + "extension for the MIME Type is known. If the MIME Type detected is 
of type text/*, attempts to identify the charset used " +
+        "and an attribute with the name 'mime.charset' is added with the value 
being the charset.")
 @WritesAttributes({
-@WritesAttribute(attribute = "mime.type", description = "This Processor sets 
the FlowFile's mime.type attribute to the detected MIME Type. "
-        + "If unable to detect the MIME Type, the attribute's value will be 
set to application/octet-stream"),
-@WritesAttribute(attribute = "mime.extension", description = "This Processor 
sets the FlowFile's mime.extension attribute to the file "
-        + "extension associated with the detected MIME Type. "
-        + "If there is no correlated extension, the attribute's value will be 
empty")
+        @WritesAttribute(attribute = "mime.type", description = "This 
Processor sets the FlowFile's mime.type attribute to the detected MIME Type. "
+                + "If unable to detect the MIME Type, the attribute's value 
will be set to application/octet-stream"),
+        @WritesAttribute(attribute = "mime.extension", description = "This 
Processor sets the FlowFile's mime.extension attribute to the file "
+                + "extension associated with the detected MIME Type. "
+                + "If there is no correlated extension, the attribute's value 
will be empty"),
+        @WritesAttribute(attribute = "mime.charset", description = "This 
Processor sets the FlowFile's mime.charset attribute to the detected charset. "
+                + "If unable to detect the charset or the detected MIME type 
is not of type text/*, the attribute's value will be empty")

Review Comment:
   Thank you for the feedback. 
   I adjusted the implementation and documentation. In the original commit, I 
followed the implementation of `mime.extension`, which is set to an empty 
string, when it cannot be determined. Should its implementation stay as is or 
be changed as well, such that it does not be set like `mime.charset`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to