{"action":"created","comment":{"url":"https://api.github.com/repos/apache/nifi/pulls/comments/67218529","id":67218529,"diff_hunk":"@@ -0,0 +1,276 @@\n+/*\n+ * Licensed to the Apache Software Foundation (ASF) under one or more\n+ * contributor license agreements.  See the NOTICE file distributed with\n+ * this work for additional information regarding copyright ownership.\n+ * The ASF licenses this file to You under the Apache License, Version 2.0\n+ * (the \"License\"); you may not use this file except in compliance with\n+ * the License.  You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.apache.nifi.processors.media;\n+\n+import java.io.IOException;\n+import java.io.InputStream;\n+import java.util.ArrayList;\n+import java.util.Collections;\n+import java.util.HashMap;\n+import java.util.HashSet;\n+import java.util.List;\n+import java.util.Map;\n+import java.util.Set;\n+import java.util.concurrent.atomic.AtomicReference;\n+import java.util.regex.Pattern;\n+\n+import org.apache.nifi.annotation.behavior.InputRequirement;\n+import org.apache.nifi.annotation.behavior.InputRequirement.Requirement;\n+import org.apache.nifi.annotation.behavior.SupportsBatching;\n+import org.apache.nifi.annotation.behavior.WritesAttribute;\n+import org.apache.nifi.annotation.behavior.WritesAttributes;\n+import org.apache.nifi.annotation.documentation.CapabilityDescription;\n+import org.apache.nifi.annotation.documentation.Tags;\n+import org.apache.nifi.annotation.lifecycle.OnScheduled;\n+import org.apache.nifi.components.PropertyDescriptor;\n+import org.apache.nifi.flowfile.FlowFile;\n+import org.apache.nifi.flowfile.attributes.CoreAttributes;\n+import org.apache.nifi.logging.ProcessorLog;\n+import org.apache.nifi.processor.AbstractProcessor;\n+import org.apache.nifi.processor.ProcessContext;\n+import org.apache.nifi.processor.ProcessSession;\n+import org.apache.nifi.processor.ProcessorInitializationContext;\n+import org.apache.nifi.processor.Relationship;\n+import org.apache.nifi.processor.exception.ProcessException;\n+import org.apache.nifi.processor.io.InputStreamCallback;\n+import org.apache.nifi.processor.util.StandardValidators;\n+import org.apache.nifi.util.ObjectHolder;\n+\n+import org.apache.tika.exception.TikaException;\n+import org.apache.tika.io.TikaInputStream;\n+import org.apache.tika.metadata.Metadata;\n+import org.apache.tika.parser.AutoDetectParser;\n+import org.apache.tika.sax.BodyContentHandler;\n+import org.xml.sax.SAXException;\n+\n+@InputRequirement(Requirement.INPUT_REQUIRED)\n+@Tags({\"media\", \"file\", \"format\", \"metadata\", \"audio\", \"video\", \"image\", \"document\", \"pdf\"})\n+@CapabilityDescription(\"Extract the content metadata from flowfiles containing audio, video, image, and other file \"\n+        + \"types.  This processor relies on the Apache Tika project for file format detection and parsing.  It \"\n+        + \"extracts a long list of metadata types for media files including audio, video, and print media \"\n+        + \"formats.\"\n+        + \"For the more details and the list of supported file types, visit the library's website \"\n+        + \"at http://tika.apache.org/.\")\n+@WritesAttributes({@WritesAttribute(attribute = \"tika.<attribute>\", description = \"The extracted content metadata \"\n+        + \"will be inserted with the attribute name \\\"tika.<attribute>\\\". \")})\n+@SupportsBatching\n+public class ExtractMediaMetadata extends AbstractProcessor {\n+\n+    public static final PropertyDescriptor MAX_NUMBER_OF_ATTRIBUTES = new PropertyDescriptor.Builder()\n+            .name(\"Max Number of Attributes\")\n+            .description(\"Specify the max number of attributes to add to the flowfile. There is no guarantee in what order\"\n+                    + \" the tags will be processed. By default it will process all of them.\")\n+            .required(false)\n+            .addValidator(StandardValidators.NON_NEGATIVE_INTEGER_VALIDATOR)\n+            .build();\n+\n+    public static final PropertyDescriptor FILENAME_FILTER = new PropertyDescriptor.Builder()\n+            .name(\"File Name Filter\")\n+            .description(\"A regular expression identifying file names which metadata should extracted.  As flowfiles\"\n+                    + \" are processed, if the file name matches this regular expression or this expression is\"\n+                    + \" blank, the flowfile will be scanned for it's MIME type and metadata.  If left blank, all\"\n+                    + \" flowfiles will be scanned.\")\n+            .required(false)\n+            .addValidator(StandardValidators.REGULAR_EXPRESSION_VALIDATOR)\n+            .build();\n+\n+    public static final PropertyDescriptor MIME_TYPE_FILTER = new PropertyDescriptor.Builder()\n+            .name(\"MIME Type Filter\")\n+            .description(\"A regular expression identifying MIME types for which metadata should extracted.  Flowfiles\"\n+                    + \" selected for scanning by the File Name Filter are parsed to determine the MIME type and extract\"\n+                    + \" metadata.  If the MIME type found matches this regular expression or this expression is\"\n+                    + \" blank, the metadata keys that match the Metadata Key Filter will be added to the flowfile\"\n+                    + \" attributes.  There is no guarantee in what order attributes will be produced.  If\"\n+                    + \" left blank, metadata will be extracted from all flow files selected for scanning.\")\n+            .required(false)\n+            .addValidator(StandardValidators.REGULAR_EXPRESSION_VALIDATOR)\n+            .build();\n+\n+    public static final PropertyDescriptor METADATA_KEY_FILTER = new PropertyDescriptor.Builder()\n+            .name(\"Metadata Key Filter\")\n+            .description(\"A regular expression identifying which metadata keys received from the parser should be\"\n+                    + \" added to the flowfile attributes.  If left blank, all metadata keys parsed will be added to the\"\n+                    + \" flowfile attributes.\")\n+            .required(false)\n+            .addValidator(StandardValidators.REGULAR_EXPRESSION_VALIDATOR)\n+            .build();","path":"nifi-nar-bundles/nifi-media-bundle/nifi-media-processors/src/main/java/org/apache/nifi/processors/media/ExtractMediaMetadata.java","position":110,"original_position":110,"commit_id":"319d4e4643a9958e196c7226155c25c74371137c","original_commit_id":"319d4e4643a9958e196c7226155c25c74371137c","user":{"login":"JPercivall","id":11302527,"avatar_url":"https://avatars.githubusercontent.com/u/11302527?v=3","gravatar_id":"","url":"https://api.github.com/users/JPercivall","html_url":"https://github.com/JPercivall","followers_url":"https://api.github.com/users/JPercivall/followers","following_url":"https://api.github.com/users/JPercivall/following{/other_user}","gists_url":"https://api.github.com/users/JPercivall/gists{/gist_id}","starred_url":"https://api.github.com/users/JPercivall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JPercivall/subscriptions","organizations_url":"https://api.github.com/users/JPercivall/orgs","repos_url":"https://api.github.com/users/JPercivall/repos","events_url":"https://api.github.com/users/JPercivall/events{/privacy}","received_events_url":"https://api.github.com/users/JPercivall/received_events","type":"User","site_admin":false},"body":"That is a very good point, I agree to not make support EL","created_at":"2016-06-15T18:31:08Z","updated_at":"2016-06-15T18:31:09Z","html_url":"https://github.com/apache/nifi/pull/252#discussion_r67218529","pull_request_url":"https://api.github.com/repos/apache/nifi/pulls/252","_links":{"self":{"href":"https://api.github.com/repos/apache/nifi/pulls/comments/67218529"},"html":{"href":"https://github.com/apache/nifi/pull/252#discussion_r67218529"},"pull_request":{"href":"https://api.github.com/repos/apache/nifi/pulls/252"}}},"pull_request":{"url":"https://api.github.com/repos/apache/nifi/pulls/252","id":61106083,"html_url":"https://github.com/apache/nifi/pull/252","diff_url":"https://github.com/apache/nifi/pull/252.diff","patch_url":"https://github.com/apache/nifi/pull/252.patch","issue_url":"https://api.github.com/repos/apache/nifi/issues/252","number":252,"state":"open","locked":false,"title":"NIFI-615 - Create a processor to extract WAV file characteristics.","user":{"login":"jskora","id":181587,"avatar_url":"https://avatars.githubusercontent.com/u/181587?v=3","gravatar_id":"","url":"https://api.github.com/users/jskora","html_url":"https://github.com/jskora","followers_url":"https://api.github.com/users/jskora/followers","following_url":"https://api.github.com/users/jskora/following{/other_user}","gists_url":"https://api.github.com/users/jskora/gists{/gist_id}","starred_url":"https://api.github.com/users/jskora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jskora/subscriptions","organizations_url":"https://api.github.com/users/jskora/orgs","repos_url":"https://api.github.com/users/jskora/repos","events_url":"https://api.github.com/users/jskora/events{/privacy}","received_events_url":"https://api.github.com/users/jskora/received_events","type":"User","site_admin":false},"body":"* Created new ExtractMediaMetadata processor using Apache Tika Detector and Parser.\r\n* Refactored nifi-image-bundle, nifi-image-nar, and nifi-image-processors to nifi-media-bundle, nifi-media-nar, and nifi-media-processors to reflect broader media related purpose.\r\n* Preserved existing ExtractImageMetadata and ResizeImage processors as well as existing ImageViewerController components to prevent impact on existing uses.","created_at":"2016-02-29T16:41:00Z","updated_at":"2016-06-15T18:31:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"68f1ba4c5b47a70a7c9c05b7b444529b8f8eae6c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/nifi/pulls/252/commits","review_comments_url":"https://api.github.com/repos/apache/nifi/pulls/252/comments","review_comment_url":"https://api.github.com/repos/apache/nifi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/nifi/issues/252/comments","statuses_url":"https://api.github.com/repos/apache/nifi/statuses/319d4e4643a9958e196c7226155c25c74371137c","head":{"label":"jskora:NIFI-615","ref":"NIFI-615","sha":"319d4e4643a9958e196c7226155c25c74371137c","user":{"login":"jskora","id":181587,"avatar_url":"https://avatars.githubusercontent.com/u/181587?v=3","gravatar_id":"","url":"https://api.github.com/users/jskora","html_url":"https://github.com/jskora","followers_url":"https://api.github.com/users/jskora/followers","following_url":"https://api.github.com/users/jskora/following{/other_user}","gists_url":"https://api.github.com/users/jskora/gists{/gist_id}","starred_url":"https://api.github.com/users/jskora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jskora/subscriptions","organizations_url":"https://api.github.com/users/jskora/orgs","repos_url":"https://api.github.com/users/jskora/repos","events_url":"https://api.github.com/users/jskora/events{/privacy}","received_events_url":"https://api.github.com/users/jskora/received_events","type":"User","site_admin":false},"repo":{"id":45012567,"name":"nifi","full_name":"jskora/nifi","owner":{"login":"jskora","id":181587,"avatar_url":"https://avatars.githubusercontent.com/u/181587?v=3","gravatar_id":"","url":"https://api.github.com/users/jskora","html_url":"https://github.com/jskora","followers_url":"https://api.github.com/users/jskora/followers","following_url":"https://api.github.com/users/jskora/following{/other_user}","gists_url":"https://api.github.com/users/jskora/gists{/gist_id}","starred_url":"https://api.github.com/users/jskora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jskora/subscriptions","organizations_url":"https://api.github.com/users/jskora/orgs","repos_url":"https://api.github.com/users/jskora/repos","events_url":"https://api.github.com/users/jskora/events{/privacy}","received_events_url":"https://api.github.com/users/jskora/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jskora/nifi","description":"Mirror of Apache NiFi","fork":true,"url":"https://api.github.com/repos/jskora/nifi","forks_url":"https://api.github.com/repos/jskora/nifi/forks","keys_url":"https://api.github.com/repos/jskora/nifi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jskora/nifi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jskora/nifi/teams","hooks_url":"https://api.github.com/repos/jskora/nifi/hooks","issue_events_url":"https://api.github.com/repos/jskora/nifi/issues/events{/number}","events_url":"https://api.github.com/repos/jskora/nifi/events","assignees_url":"https://api.github.com/repos/jskora/nifi/assignees{/user}","branches_url":"https://api.github.com/repos/jskora/nifi/branches{/branch}","tags_url":"https://api.github.com/repos/jskora/nifi/tags","blobs_url":"https://api.github.com/repos/jskora/nifi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jskora/nifi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jskora/nifi/git/refs{/sha}","trees_url":"https://api.github.com/repos/jskora/nifi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jskora/nifi/statuses/{sha}","languages_url":"https://api.github.com/repos/jskora/nifi/languages","stargazers_url":"https://api.github.com/repos/jskora/nifi/stargazers","contributors_url":"https://api.github.com/repos/jskora/nifi/contributors","subscribers_url":"https://api.github.com/repos/jskora/nifi/subscribers","subscription_url":"https://api.github.com/repos/jskora/nifi/subscription","commits_url":"https://api.github.com/repos/jskora/nifi/commits{/sha}","git_commits_url":"https://api.github.com/repos/jskora/nifi/git/commits{/sha}","comments_url":"https://api.github.com/repos/jskora/nifi/comments{/number}","issue_comment_url":"https://api.github.com/repos/jskora/nifi/issues/comments{/number}","contents_url":"https://api.github.com/repos/jskora/nifi/contents/{+path}","compare_url":"https://api.github.com/repos/jskora/nifi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jskora/nifi/merges","archive_url":"https://api.github.com/repos/jskora/nifi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jskora/nifi/downloads","issues_url":"https://api.github.com/repos/jskora/nifi/issues{/number}","pulls_url":"https://api.github.com/repos/jskora/nifi/pulls{/number}","milestones_url":"https://api.github.com/repos/jskora/nifi/milestones{/number}","notifications_url":"https://api.github.com/repos/jskora/nifi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jskora/nifi/labels{/name}","releases_url":"https://api.github.com/repos/jskora/nifi/releases{/id}","deployments_url":"https://api.github.com/repos/jskora/nifi/deployments","created_at":"2015-10-27T02:46:40Z","updated_at":"2016-01-29T16:01:33Z","pushed_at":"2016-06-14T17:23:29Z","git_url":"git://github.com/jskora/nifi.git","ssh_url":"git@github.com:jskora/nifi.git","clone_url":"https://github.com/jskora/nifi.git","svn_url":"https://github.com/jskora/nifi","homepage":"","size":46088,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"5999eab43fea5d7efc481182e0af0e2a19f960d4","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":27911088,"name":"nifi","full_name":"apache/nifi","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/nifi","description":"Mirror of Apache NiFi","fork":false,"url":"https://api.github.com/repos/apache/nifi","forks_url":"https://api.github.com/repos/apache/nifi/forks","keys_url":"https://api.github.com/repos/apache/nifi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/nifi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/nifi/teams","hooks_url":"https://api.github.com/repos/apache/nifi/hooks","issue_events_url":"https://api.github.com/repos/apache/nifi/issues/events{/number}","events_url":"https://api.github.com/repos/apache/nifi/events","assignees_url":"https://api.github.com/repos/apache/nifi/assignees{/user}","branches_url":"https://api.github.com/repos/apache/nifi/branches{/branch}","tags_url":"https://api.github.com/repos/apache/nifi/tags","blobs_url":"https://api.github.com/repos/apache/nifi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/nifi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/nifi/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/nifi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/nifi/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/nifi/languages","stargazers_url":"https://api.github.com/repos/apache/nifi/stargazers","contributors_url":"https://api.github.com/repos/apache/nifi/contributors","subscribers_url":"https://api.github.com/repos/apache/nifi/subscribers","subscription_url":"https://api.github.com/repos/apache/nifi/subscription","commits_url":"https://api.github.com/repos/apache/nifi/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/nifi/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/nifi/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/nifi/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/nifi/contents/{+path}","compare_url":"https://api.github.com/repos/apache/nifi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/nifi/merges","archive_url":"https://api.github.com/repos/apache/nifi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/nifi/downloads","issues_url":"https://api.github.com/repos/apache/nifi/issues{/number}","pulls_url":"https://api.github.com/repos/apache/nifi/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/nifi/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/nifi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/nifi/labels{/name}","releases_url":"https://api.github.com/repos/apache/nifi/releases{/id}","deployments_url":"https://api.github.com/repos/apache/nifi/deployments","created_at":"2014-12-12T08:00:05Z","updated_at":"2016-06-15T16:46:33Z","pushed_at":"2016-06-15T17:55:36Z","git_url":"git://github.com/apache/nifi.git","ssh_url":"git@github.com:apache/nifi.git","clone_url":"https://github.com/apache/nifi.git","svn_url":"https://github.com/apache/nifi","homepage":"","size":68094,"stargazers_count":293,"watchers_count":293,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":262,"mirror_url":"git://git.apache.org/nifi.git","open_issues_count":57,"forks":262,"open_issues":57,"watchers":293,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/nifi/pulls/252"},"html":{"href":"https://github.com/apache/nifi/pull/252"},"issue":{"href":"https://api.github.com/repos/apache/nifi/issues/252"},"comments":{"href":"https://api.github.com/repos/apache/nifi/issues/252/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/nifi/pulls/252/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/nifi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/nifi/pulls/252/commits"},"statuses":{"href":"https://api.github.com/repos/apache/nifi/statuses/319d4e4643a9958e196c7226155c25c74371137c"}}}}
{"actor":{"display_login":"JPercivall"}}