{"action":"created","comment":{"url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/pulls/comments/92905834","pull_request_review_id":13431608,"id":92905834,"diff_hunk":"@@ -0,0 +1,118 @@\n+/*\n+ * ******************************************************************************\n+ *   Copyright 2014-2016 Spectra Logic Corporation. All Rights Reserved.\n+ *   Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use\n+ *   this file except in compliance with the License. A copy of the License is located at\n+ *\n+ *   http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ *   or in the \"license\" file accompanying this file.\n+ *   This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n+ *   CONDITIONS OF ANY KIND, either express or implied. See the License for the\n+ *   specific language governing permissions and limitations under the License.\n+ * ****************************************************************************\n+ */\n+\n+package com.spectralogic.ds3client.commands.interfaces;\n+\n+import com.google.common.collect.ImmutableSet;\n+import com.google.common.collect.Multimap;\n+import com.spectralogic.ds3client.networking.NetworkClientImpl;\n+\n+import javax.annotation.Nullable;\n+import java.util.ArrayList;\n+import java.util.Collection;\n+import java.util.Map;\n+import java.util.Set;\n+\n+import static com.spectralogic.ds3client.utils.MetadataStringManipulation.toDecodedString;\n+import static com.spectralogic.ds3client.utils.MetadataStringManipulation.toEncodedString;\n+\n+/**\n+ * Implementation of request headers which percent encodes key and values.\n+ */\n+public class RequestHeadersImpl implements RequestHeaders {\n+\n+    private final Multimap<String, String> headers;\n+\n+    public RequestHeadersImpl(final Multimap<String, String> defaultHeaders) {\n+        this.headers = defaultHeaders;\n+    }\n+\n+    /**\n+     * Puts the percent encoded key/value pair into headers\n+     */\n+    @Override\n+    public void put(final String key, final String value) {\n+        headers.put(toEncodedString(key), toEncodedString(value));\n+    }\n+\n+    /**\n+     * Retrieves the non-percent encoded values for the key\n+     * @param key non-percent encoded header key\n+     */\n+    @Override\n+    public Collection<String> get(@Nullable final String key) {\n+        final Collection<String> values = headers.get(key);\n+        final Collection<String> decodedValues = new ArrayList<>();\n+        for (final String value : values) {\n+            decodedValues.add(toDecodedString(value));\n+        }\n+        return decodedValues;\n+    }\n+\n+    /**\n+     * Retrieves the size of the headers multimap\n+     */\n+    @Override\n+    public int size() {\n+        return headers.size();\n+    }\n+\n+    /**\n+     * Checks if the headers contains a percent-encoded version of the key\n+     * @param key non-percent encoded header key\n+     */\n+    @Override\n+    public boolean containsKey(@Nullable final String key) {\n+        return headers.containsKey(toEncodedString(key));\n+    }\n+\n+    /**\n+     * Removes all instances of the percent encoded key from headers\n+     * @param key non-percent encoded header key\n+     */\n+    @Override\n+    public Collection<String> removeAll(@Nullable final String key) {","path":"ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/RequestHeadersImpl.java","position":86,"original_position":86,"commit_id":"be6729f6fcfaa132cc378a8ab9190b77dee04059","original_commit_id":"be6729f6fcfaa132cc378a8ab9190b77dee04059","user":{"login":"rpmoore","id":1901294,"avatar_url":"https://avatars.githubusercontent.com/u/1901294?v=3","gravatar_id":"","url":"https://api.github.com/users/rpmoore","html_url":"https://github.com/rpmoore","followers_url":"https://api.github.com/users/rpmoore/followers","following_url":"https://api.github.com/users/rpmoore/following{/other_user}","gists_url":"https://api.github.com/users/rpmoore/gists{/gist_id}","starred_url":"https://api.github.com/users/rpmoore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rpmoore/subscriptions","organizations_url":"https://api.github.com/users/rpmoore/orgs","repos_url":"https://api.github.com/users/rpmoore/repos","events_url":"https://api.github.com/users/rpmoore/events{/privacy}","received_events_url":"https://api.github.com/users/rpmoore/received_events","type":"User","site_admin":false},"body":"Does this call actually allow for null values?","created_at":"2016-12-16T23:57:34Z","updated_at":"2016-12-16T23:58:48Z","html_url":"https://github.com/SpectraLogic/ds3_java_sdk/pull/401#discussion_r92905834","pull_request_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/pulls/401","_links":{"self":{"href":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/pulls/comments/92905834"},"html":{"href":"https://github.com/SpectraLogic/ds3_java_sdk/pull/401#discussion_r92905834"},"pull_request":{"href":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/pulls/401"}}},"pull_request":{"url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/pulls/401","id":97818468,"html_url":"https://github.com/SpectraLogic/ds3_java_sdk/pull/401","diff_url":"https://github.com/SpectraLogic/ds3_java_sdk/pull/401.diff","patch_url":"https://github.com/SpectraLogic/ds3_java_sdk/pull/401.patch","issue_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/issues/401","number":401,"state":"open","locked":false,"title":"Percent encode metadata","user":{"login":"RachelTucker","id":14060133,"avatar_url":"https://avatars.githubusercontent.com/u/14060133?v=3","gravatar_id":"","url":"https://api.github.com/users/RachelTucker","html_url":"https://github.com/RachelTucker","followers_url":"https://api.github.com/users/RachelTucker/followers","following_url":"https://api.github.com/users/RachelTucker/following{/other_user}","gists_url":"https://api.github.com/users/RachelTucker/gists{/gist_id}","starred_url":"https://api.github.com/users/RachelTucker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RachelTucker/subscriptions","organizations_url":"https://api.github.com/users/RachelTucker/orgs","repos_url":"https://api.github.com/users/RachelTucker/repos","events_url":"https://api.github.com/users/RachelTucker/events{/privacy}","received_events_url":"https://api.github.com/users/RachelTucker/received_events","type":"User","site_admin":false},"body":"**Changes**\r\n- Created request header wrapper that percent encodes metadata\r\n- Added percent decoding to response HeadersImpl\r\n- Added metadata encoding integration tests","created_at":"2016-12-13T19:28:37Z","updated_at":"2016-12-16T23:58:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a54430dffa09923805032c357e6b23f2f6d3d515","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/pulls/401/commits","review_comments_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/pulls/401/comments","review_comment_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/issues/401/comments","statuses_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/statuses/be6729f6fcfaa132cc378a8ab9190b77dee04059","head":{"label":"RachelTucker:JSDK_168","ref":"JSDK_168","sha":"be6729f6fcfaa132cc378a8ab9190b77dee04059","user":{"login":"RachelTucker","id":14060133,"avatar_url":"https://avatars.githubusercontent.com/u/14060133?v=3","gravatar_id":"","url":"https://api.github.com/users/RachelTucker","html_url":"https://github.com/RachelTucker","followers_url":"https://api.github.com/users/RachelTucker/followers","following_url":"https://api.github.com/users/RachelTucker/following{/other_user}","gists_url":"https://api.github.com/users/RachelTucker/gists{/gist_id}","starred_url":"https://api.github.com/users/RachelTucker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RachelTucker/subscriptions","organizations_url":"https://api.github.com/users/RachelTucker/orgs","repos_url":"https://api.github.com/users/RachelTucker/repos","events_url":"https://api.github.com/users/RachelTucker/events{/privacy}","received_events_url":"https://api.github.com/users/RachelTucker/received_events","type":"User","site_admin":false},"repo":{"id":41758816,"name":"ds3_java_sdk","full_name":"RachelTucker/ds3_java_sdk","owner":{"login":"RachelTucker","id":14060133,"avatar_url":"https://avatars.githubusercontent.com/u/14060133?v=3","gravatar_id":"","url":"https://api.github.com/users/RachelTucker","html_url":"https://github.com/RachelTucker","followers_url":"https://api.github.com/users/RachelTucker/followers","following_url":"https://api.github.com/users/RachelTucker/following{/other_user}","gists_url":"https://api.github.com/users/RachelTucker/gists{/gist_id}","starred_url":"https://api.github.com/users/RachelTucker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RachelTucker/subscriptions","organizations_url":"https://api.github.com/users/RachelTucker/orgs","repos_url":"https://api.github.com/users/RachelTucker/repos","events_url":"https://api.github.com/users/RachelTucker/events{/privacy}","received_events_url":"https://api.github.com/users/RachelTucker/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/RachelTucker/ds3_java_sdk","description":null,"fork":true,"url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk","forks_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/forks","keys_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/teams","hooks_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/hooks","issue_events_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/issues/events{/number}","events_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/events","assignees_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/assignees{/user}","branches_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/branches{/branch}","tags_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/tags","blobs_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/languages","stargazers_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/stargazers","contributors_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/contributors","subscribers_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/subscribers","subscription_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/subscription","commits_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/contents/{+path}","compare_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/merges","archive_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/downloads","issues_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/issues{/number}","pulls_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/labels{/name}","releases_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/releases{/id}","deployments_url":"https://api.github.com/repos/RachelTucker/ds3_java_sdk/deployments","created_at":"2015-09-01T19:30:19Z","updated_at":"2016-02-03T20:23:42Z","pushed_at":"2016-12-16T20:47:16Z","git_url":"git://github.com/RachelTucker/ds3_java_sdk.git","ssh_url":"git@github.com:RachelTucker/ds3_java_sdk.git","clone_url":"https://github.com/RachelTucker/ds3_java_sdk.git","svn_url":"https://github.com/RachelTucker/ds3_java_sdk","homepage":null,"size":12770,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SpectraLogic:master","ref":"master","sha":"2759de377b59ba3727d1d50132ac0ffeaa022ae9","user":{"login":"SpectraLogic","id":7060807,"avatar_url":"https://avatars.githubusercontent.com/u/7060807?v=3","gravatar_id":"","url":"https://api.github.com/users/SpectraLogic","html_url":"https://github.com/SpectraLogic","followers_url":"https://api.github.com/users/SpectraLogic/followers","following_url":"https://api.github.com/users/SpectraLogic/following{/other_user}","gists_url":"https://api.github.com/users/SpectraLogic/gists{/gist_id}","starred_url":"https://api.github.com/users/SpectraLogic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpectraLogic/subscriptions","organizations_url":"https://api.github.com/users/SpectraLogic/orgs","repos_url":"https://api.github.com/users/SpectraLogic/repos","events_url":"https://api.github.com/users/SpectraLogic/events{/privacy}","received_events_url":"https://api.github.com/users/SpectraLogic/received_events","type":"Organization","site_admin":false},"repo":{"id":18419946,"name":"ds3_java_sdk","full_name":"SpectraLogic/ds3_java_sdk","owner":{"login":"SpectraLogic","id":7060807,"avatar_url":"https://avatars.githubusercontent.com/u/7060807?v=3","gravatar_id":"","url":"https://api.github.com/users/SpectraLogic","html_url":"https://github.com/SpectraLogic","followers_url":"https://api.github.com/users/SpectraLogic/followers","following_url":"https://api.github.com/users/SpectraLogic/following{/other_user}","gists_url":"https://api.github.com/users/SpectraLogic/gists{/gist_id}","starred_url":"https://api.github.com/users/SpectraLogic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpectraLogic/subscriptions","organizations_url":"https://api.github.com/users/SpectraLogic/orgs","repos_url":"https://api.github.com/users/SpectraLogic/repos","events_url":"https://api.github.com/users/SpectraLogic/events{/privacy}","received_events_url":"https://api.github.com/users/SpectraLogic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SpectraLogic/ds3_java_sdk","description":null,"fork":false,"url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk","forks_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/forks","keys_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/teams","hooks_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/hooks","issue_events_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/issues/events{/number}","events_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/events","assignees_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/assignees{/user}","branches_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/branches{/branch}","tags_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/tags","blobs_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/languages","stargazers_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/stargazers","contributors_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/contributors","subscribers_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/subscribers","subscription_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/subscription","commits_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/contents/{+path}","compare_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/merges","archive_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/downloads","issues_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/issues{/number}","pulls_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/labels{/name}","releases_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/releases{/id}","deployments_url":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/deployments","created_at":"2014-04-03T22:17:11Z","updated_at":"2016-11-02T22:30:18Z","pushed_at":"2016-12-16T23:55:22Z","git_url":"git://github.com/SpectraLogic/ds3_java_sdk.git","ssh_url":"git@github.com:SpectraLogic/ds3_java_sdk.git","clone_url":"https://github.com/SpectraLogic/ds3_java_sdk.git","svn_url":"https://github.com/SpectraLogic/ds3_java_sdk","homepage":null,"size":19852,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":12,"mirror_url":null,"open_issues_count":4,"forks":12,"open_issues":4,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/pulls/401"},"html":{"href":"https://github.com/SpectraLogic/ds3_java_sdk/pull/401"},"issue":{"href":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/issues/401"},"comments":{"href":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/issues/401/comments"},"review_comments":{"href":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/pulls/401/comments"},"review_comment":{"href":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/pulls/401/commits"},"statuses":{"href":"https://api.github.com/repos/SpectraLogic/ds3_java_sdk/statuses/be6729f6fcfaa132cc378a8ab9190b77dee04059"}}}}
{"actor":{"display_login":"rpmoore"}}