{"action":"created","comment":{"url":"https://api.github.com/repos/apache/nifi/pulls/comments/36204722","id":36204722,"diff_hunk":"@@ -0,0 +1,125 @@\n+/*\r\n+ * Licensed to the Apache Software Foundation (ASF) under one or more\r\n+ * contributor license agreements.  See the NOTICE file distributed with\r\n+ * this work for additional information regarding copyright ownership.\r\n+ * The ASF licenses this file to You under the Apache License, Version 2.0\r\n+ * (the \"License\"); you may not use this file except in compliance with\r\n+ * the License.  You may obtain a copy of the License at\r\n+ *\r\n+ *     http://www.apache.org/licenses/LICENSE-2.0\r\n+ *\r\n+ * Unless required by applicable law or agreed to in writing, software\r\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n+ * See the License for the specific language governing permissions and\r\n+ * limitations under the License.\r\n+ */\r\n+package org.apache.nifi.processors.aws.s3;\r\n+\r\n+import java.io.IOException;\r\n+import java.util.*;\r\n+import java.util.concurrent.TimeUnit;\r\n+\r\n+import com.amazonaws.AmazonClientException;\r\n+import com.amazonaws.services.s3.AmazonS3;\r\n+import com.amazonaws.services.s3.model.*;\r\n+import org.apache.nifi.annotation.behavior.*;\r\n+import org.apache.nifi.annotation.documentation.CapabilityDescription;\r\n+import org.apache.nifi.annotation.documentation.SeeAlso;\r\n+import org.apache.nifi.annotation.documentation.Tags;\r\n+import org.apache.nifi.components.PropertyDescriptor;\r\n+import org.apache.nifi.flowfile.FlowFile;\r\n+import org.apache.nifi.processor.ProcessContext;\r\n+import org.apache.nifi.processor.ProcessSession;\r\n+import org.apache.nifi.processor.util.StandardValidators;\r\n+\r\n+@SupportsBatching\r\n+@SeeAlso({PutS3Object.class})\r\n+@Tags({\"Amazon\", \"S3\", \"AWS\", \"Archive\", \"Delete\"})\r\n+@CapabilityDescription(\"Deletes FlowFiles on an Amazon S3 Bucket\")\r\n+@DynamicProperty(name = \"The name of a User-Defined Metadata field to add to the S3 Object\",\r\n+        value = \"The value of a User-Defined Metadata field to add to the S3 Object\",\r\n+        description = \"Allows user-defined metadata to be added to the S3 object as key/value pairs\",\r\n+        supportsExpressionLanguage = true)\r\n+@ReadsAttribute(attribute = \"filename\", description = \"Uses the FlowFile's filename as the filename for the S3 object\")\r\n+@WritesAttributes({\r\n+        @WritesAttribute(attribute = \"s3.bucket\", description = \"The name of the S3 bucket\"),\r\n+        @WritesAttribute(attribute = \"s3.version\", description = \"The version of the S3 Object\"),\r\n+        @WritesAttribute(attribute = \"path\", description = \"The path of the file\"),\r\n+})\r\n+public class DeleteS3Object extends AbstractS3Processor {\r\n+\r\n+    public static final PropertyDescriptor VERSION_ID = new PropertyDescriptor.Builder()\r\n+            .name(\"Version\")\r\n+            .description(\"The Version of the Object to delete\")\r\n+            .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)\r\n+            .expressionLanguageSupported(true)\r\n+            .required(false)\r\n+            .build();\r\n+\r\n+    public static final List<PropertyDescriptor> properties = Collections.unmodifiableList(\r\n+            Arrays.asList(KEY, BUCKET, ACCESS_KEY, SECRET_KEY, CREDENTAILS_FILE, REGION, TIMEOUT,\r\n+                    FULL_CONTROL_USER_LIST, READ_USER_LIST, WRITE_USER_LIST, READ_ACL_LIST, WRITE_ACL_LIST, OWNER));\r\n+\r\n+    @Override\r\n+    protected List<PropertyDescriptor> getSupportedPropertyDescriptors() {\r\n+        return properties;\r\n+    }\r\n+\r\n+    @Override\r\n+    protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(final String propertyDescriptorName) {\r\n+        return new PropertyDescriptor.Builder()\r\n+                .name(propertyDescriptorName)\r\n+                .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)\r\n+                .expressionLanguageSupported(true)\r\n+                .dynamic(true)\r\n+                .build();\r\n+    }\r\n+\r\n+    public void onTrigger(final ProcessContext context, final ProcessSession session) {\r\n+        FlowFile flowFile = session.get();\r\n+        if (flowFile == null) {\r\n+            return;\r\n+        }\r\n+\r\n+        final long startNanos = System.nanoTime();\r\n+\r\n+        final String bucket = context.getProperty(BUCKET).evaluateAttributeExpressions(flowFile).getValue();\r\n+        final String key = context.getProperty(KEY).evaluateAttributeExpressions(flowFile).getValue();\r\n+        final String versionId = context.getProperty(VERSION_ID).evaluateAttributeExpressions(flowFile).getValue();\r\n+\r\n+        final AmazonS3 s3 = getClient();\r\n+        final FlowFile ff = flowFile;\r\n+        final GetObjectRequest request;\r\n+        if (versionId == null) {\r\n+            request = new GetObjectRequest(bucket, key);\r\n+        } else {\r\n+            request = new GetObjectRequest(bucket, key, versionId);\r\n+        }\r\n+\r\n+        final Map<String, String> attributes = new HashMap<>();\r","path":"nifi/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/DeleteS3Object.java","position":100,"original_position":100,"commit_id":"d993e68e7c5421c489b13e1b59bcc6f032802fe4","original_commit_id":"d993e68e7c5421c489b13e1b59bcc6f032802fe4","user":{"login":"danbress","id":10684595,"avatar_url":"https://avatars.githubusercontent.com/u/10684595?v=3","gravatar_id":"","url":"https://api.github.com/users/danbress","html_url":"https://github.com/danbress","followers_url":"https://api.github.com/users/danbress/followers","following_url":"https://api.github.com/users/danbress/following{/other_user}","gists_url":"https://api.github.com/users/danbress/gists{/gist_id}","starred_url":"https://api.github.com/users/danbress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danbress/subscriptions","organizations_url":"https://api.github.com/users/danbress/orgs","repos_url":"https://api.github.com/users/danbress/repos","events_url":"https://api.github.com/users/danbress/events{/privacy}","received_events_url":"https://api.github.com/users/danbress/received_events","type":"User","site_admin":false},"body":"An entry is added to this map, but the map is never used again.  What is the purpose of this map?","created_at":"2015-08-04T15:50:39Z","updated_at":"2015-08-04T15:50:39Z","html_url":"https://github.com/apache/nifi/pull/72#discussion_r36204722","pull_request_url":"https://api.github.com/repos/apache/nifi/pulls/72","_links":{"self":{"href":"https://api.github.com/repos/apache/nifi/pulls/comments/36204722"},"html":{"href":"https://github.com/apache/nifi/pull/72#discussion_r36204722"},"pull_request":{"href":"https://api.github.com/repos/apache/nifi/pulls/72"}}},"pull_request":{"url":"https://api.github.com/repos/apache/nifi/pulls/72","id":41427303,"html_url":"https://github.com/apache/nifi/pull/72","diff_url":"https://github.com/apache/nifi/pull/72.diff","patch_url":"https://github.com/apache/nifi/pull/72.patch","issue_url":"https://api.github.com/repos/apache/nifi/issues/72","number":72,"state":"open","locked":false,"title":"[NIFI-774] Create a DeleteS3Object Processor","user":{"login":"yu-iskw","id":1523515,"avatar_url":"https://avatars.githubusercontent.com/u/1523515?v=3","gravatar_id":"","url":"https://api.github.com/users/yu-iskw","html_url":"https://github.com/yu-iskw","followers_url":"https://api.github.com/users/yu-iskw/followers","following_url":"https://api.github.com/users/yu-iskw/following{/other_user}","gists_url":"https://api.github.com/users/yu-iskw/gists{/gist_id}","starred_url":"https://api.github.com/users/yu-iskw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yu-iskw/subscriptions","organizations_url":"https://api.github.com/users/yu-iskw/orgs","repos_url":"https://api.github.com/users/yu-iskw/repos","events_url":"https://api.github.com/users/yu-iskw/events{/privacy}","received_events_url":"https://api.github.com/users/yu-iskw/received_events","type":"User","site_admin":false},"body":"[[NIFI-774] Create a DeleteS3Object Processor - ASF JIRA](https://issues.apache.org/jira/browse/NIFI-774)","created_at":"2015-08-03T00:01:56Z","updated_at":"2015-08-04T15:50:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"573580ed9e51faa9492e462e081942ccd8487c87","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/nifi/pulls/72/commits","review_comments_url":"https://api.github.com/repos/apache/nifi/pulls/72/comments","review_comment_url":"https://api.github.com/repos/apache/nifi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/nifi/issues/72/comments","statuses_url":"https://api.github.com/repos/apache/nifi/statuses/d993e68e7c5421c489b13e1b59bcc6f032802fe4","head":{"label":"yu-iskw:NIFI-774","ref":"NIFI-774","sha":"d993e68e7c5421c489b13e1b59bcc6f032802fe4","user":{"login":"yu-iskw","id":1523515,"avatar_url":"https://avatars.githubusercontent.com/u/1523515?v=3","gravatar_id":"","url":"https://api.github.com/users/yu-iskw","html_url":"https://github.com/yu-iskw","followers_url":"https://api.github.com/users/yu-iskw/followers","following_url":"https://api.github.com/users/yu-iskw/following{/other_user}","gists_url":"https://api.github.com/users/yu-iskw/gists{/gist_id}","starred_url":"https://api.github.com/users/yu-iskw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yu-iskw/subscriptions","organizations_url":"https://api.github.com/users/yu-iskw/orgs","repos_url":"https://api.github.com/users/yu-iskw/repos","events_url":"https://api.github.com/users/yu-iskw/events{/privacy}","received_events_url":"https://api.github.com/users/yu-iskw/received_events","type":"User","site_admin":false},"repo":{"id":39481634,"name":"nifi","full_name":"yu-iskw/nifi","owner":{"login":"yu-iskw","id":1523515,"avatar_url":"https://avatars.githubusercontent.com/u/1523515?v=3","gravatar_id":"","url":"https://api.github.com/users/yu-iskw","html_url":"https://github.com/yu-iskw","followers_url":"https://api.github.com/users/yu-iskw/followers","following_url":"https://api.github.com/users/yu-iskw/following{/other_user}","gists_url":"https://api.github.com/users/yu-iskw/gists{/gist_id}","starred_url":"https://api.github.com/users/yu-iskw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yu-iskw/subscriptions","organizations_url":"https://api.github.com/users/yu-iskw/orgs","repos_url":"https://api.github.com/users/yu-iskw/repos","events_url":"https://api.github.com/users/yu-iskw/events{/privacy}","received_events_url":"https://api.github.com/users/yu-iskw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yu-iskw/nifi","description":"Mirror of Apache NiFi","fork":true,"url":"https://api.github.com/repos/yu-iskw/nifi","forks_url":"https://api.github.com/repos/yu-iskw/nifi/forks","keys_url":"https://api.github.com/repos/yu-iskw/nifi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yu-iskw/nifi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yu-iskw/nifi/teams","hooks_url":"https://api.github.com/repos/yu-iskw/nifi/hooks","issue_events_url":"https://api.github.com/repos/yu-iskw/nifi/issues/events{/number}","events_url":"https://api.github.com/repos/yu-iskw/nifi/events","assignees_url":"https://api.github.com/repos/yu-iskw/nifi/assignees{/user}","branches_url":"https://api.github.com/repos/yu-iskw/nifi/branches{/branch}","tags_url":"https://api.github.com/repos/yu-iskw/nifi/tags","blobs_url":"https://api.github.com/repos/yu-iskw/nifi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yu-iskw/nifi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yu-iskw/nifi/git/refs{/sha}","trees_url":"https://api.github.com/repos/yu-iskw/nifi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yu-iskw/nifi/statuses/{sha}","languages_url":"https://api.github.com/repos/yu-iskw/nifi/languages","stargazers_url":"https://api.github.com/repos/yu-iskw/nifi/stargazers","contributors_url":"https://api.github.com/repos/yu-iskw/nifi/contributors","subscribers_url":"https://api.github.com/repos/yu-iskw/nifi/subscribers","subscription_url":"https://api.github.com/repos/yu-iskw/nifi/subscription","commits_url":"https://api.github.com/repos/yu-iskw/nifi/commits{/sha}","git_commits_url":"https://api.github.com/repos/yu-iskw/nifi/git/commits{/sha}","comments_url":"https://api.github.com/repos/yu-iskw/nifi/comments{/number}","issue_comment_url":"https://api.github.com/repos/yu-iskw/nifi/issues/comments{/number}","contents_url":"https://api.github.com/repos/yu-iskw/nifi/contents/{+path}","compare_url":"https://api.github.com/repos/yu-iskw/nifi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yu-iskw/nifi/merges","archive_url":"https://api.github.com/repos/yu-iskw/nifi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yu-iskw/nifi/downloads","issues_url":"https://api.github.com/repos/yu-iskw/nifi/issues{/number}","pulls_url":"https://api.github.com/repos/yu-iskw/nifi/pulls{/number}","milestones_url":"https://api.github.com/repos/yu-iskw/nifi/milestones{/number}","notifications_url":"https://api.github.com/repos/yu-iskw/nifi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yu-iskw/nifi/labels{/name}","releases_url":"https://api.github.com/repos/yu-iskw/nifi/releases{/id}","created_at":"2015-07-22T02:43:54Z","updated_at":"2015-07-22T02:44:03Z","pushed_at":"2015-08-03T00:01:29Z","git_url":"git://github.com/yu-iskw/nifi.git","ssh_url":"git@github.com:yu-iskw/nifi.git","clone_url":"https://github.com/yu-iskw/nifi.git","svn_url":"https://github.com/yu-iskw/nifi","homepage":"","size":31961,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"develop"}},"base":{"label":"apache:develop","ref":"develop","sha":"496ebfb3be78bf47c0aa957a3f44fdc76e488e5a","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}","created_at":"2014-12-12T08:00:05Z","updated_at":"2015-08-04T15:27:13Z","pushed_at":"2015-08-04T12:56:25Z","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":64066,"stargazers_count":83,"watchers_count":83,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":68,"mirror_url":"git://git.apache.org/incubator-nifi.git","open_issues_count":5,"forks":68,"open_issues":5,"watchers":83,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/nifi/pulls/72"},"html":{"href":"https://github.com/apache/nifi/pull/72"},"issue":{"href":"https://api.github.com/repos/apache/nifi/issues/72"},"comments":{"href":"https://api.github.com/repos/apache/nifi/issues/72/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/nifi/pulls/72/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/nifi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/nifi/pulls/72/commits"},"statuses":{"href":"https://api.github.com/repos/apache/nifi/statuses/d993e68e7c5421c489b13e1b59bcc6f032802fe4"}}}}