{"action":"created","comment":{"url":"https://api.github.com/repos/teamed/nerodesk/pulls/comments/27768329","id":27768329,"diff_hunk":"@@ -0,0 +1,80 @@\n+/**\n+ * Copyright (c) 2015, nerodesk.com\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions\n+ * are met: 1) Redistributions of source code must retain the above\n+ * copyright notice, this list of conditions and the following\n+ * disclaimer. 2) Redistributions in binary form must reproduce the above\n+ * copyright notice, this list of conditions and the following\n+ * disclaimer in the documentation and/or other materials provided\n+ * with the distribution. 3) Neither the name of the nerodesk.com nor\n+ * the names of its contributors may be used to endorse or promote\n+ * products derived from this software without specific prior written\n+ * permission.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT\n+ * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL\n+ * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n+ * OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+package com.nerodesk.takes;\n+\n+import java.io.IOException;\n+import java.util.regex.Matcher;\n+import java.util.regex.Pattern;\n+import org.takes.rq.RqHeaders;\n+\n+/**\n+ * Extracts properties from Content-Disposition header.\n+ *\n+ * @author Carlos Alexandro Becker (caarlos0@gmail.com)\n+ * @version $Id$\n+ * @since 0.3\n+ */\n+public final class TsContentDisposition {\n+    /**\n+     * Regex to get the filename from header.\n+     */\n+    @SuppressWarnings(\"PMD.AvoidFieldNameMatchingMethodName\")\n+    private static final Pattern FILENAME = Pattern","path":"src/main/java/com/nerodesk/takes/TsContentDisposition.java","position":49,"original_position":49,"commit_id":"a18e812230692a52e68cc9d49ed854908abad574","original_commit_id":"a18e812230692a52e68cc9d49ed854908abad574","user":{"login":"krzyk","id":105730,"avatar_url":"https://avatars.githubusercontent.com/u/105730?v=3","gravatar_id":"","url":"https://api.github.com/users/krzyk","html_url":"https://github.com/krzyk","followers_url":"https://api.github.com/users/krzyk/followers","following_url":"https://api.github.com/users/krzyk/following{/other_user}","gists_url":"https://api.github.com/users/krzyk/gists{/gist_id}","starred_url":"https://api.github.com/users/krzyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krzyk/subscriptions","organizations_url":"https://api.github.com/users/krzyk/orgs","repos_url":"https://api.github.com/users/krzyk/repos","events_url":"https://api.github.com/users/krzyk/events{/privacy}","received_events_url":"https://api.github.com/users/krzyk/received_events","type":"User","site_admin":false},"body":"@caarlos0 let's change the name of constant to e.g. `HEADER_FILENAME` or `HEADER_FNAME` and get rid of PMD suppression","created_at":"2015-04-04T11:18:59Z","updated_at":"2015-04-04T11:18:59Z","html_url":"https://github.com/teamed/nerodesk/pull/181#discussion_r27768329","pull_request_url":"https://api.github.com/repos/teamed/nerodesk/pulls/181","_links":{"self":{"href":"https://api.github.com/repos/teamed/nerodesk/pulls/comments/27768329"},"html":{"href":"https://github.com/teamed/nerodesk/pull/181#discussion_r27768329"},"pull_request":{"href":"https://api.github.com/repos/teamed/nerodesk/pulls/181"}}},"pull_request":{"url":"https://api.github.com/repos/teamed/nerodesk/pulls/181","id":32619335,"html_url":"https://github.com/teamed/nerodesk/pull/181","diff_url":"https://github.com/teamed/nerodesk/pull/181.diff","patch_url":"https://github.com/teamed/nerodesk/pull/181.patch","issue_url":"https://api.github.com/repos/teamed/nerodesk/issues/181","number":181,"state":"open","locked":false,"title":"Get filename from Content-Disposition","user":{"login":"caarlos0","id":245435,"avatar_url":"https://avatars.githubusercontent.com/u/245435?v=3","gravatar_id":"","url":"https://api.github.com/users/caarlos0","html_url":"https://github.com/caarlos0","followers_url":"https://api.github.com/users/caarlos0/followers","following_url":"https://api.github.com/users/caarlos0/following{/other_user}","gists_url":"https://api.github.com/users/caarlos0/gists{/gist_id}","starred_url":"https://api.github.com/users/caarlos0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caarlos0/subscriptions","organizations_url":"https://api.github.com/users/caarlos0/orgs","repos_url":"https://api.github.com/users/caarlos0/repos","events_url":"https://api.github.com/users/caarlos0/events{/privacy}","received_events_url":"https://api.github.com/users/caarlos0/received_events","type":"User","site_admin":false},"body":"The original todo was:\r\n\r\n> I tried to get filename from file meta data and it doesn't look clean but works for now. We have to either wait for impl. from `Takes` framework or implement in this project class that is going to do this in clean way.\r\n\r\nSo, I created a separated class to deal with just this thing and covered it with tests. I also refactored a little the original method by separating it in two (there is another todo talking about that btw).","created_at":"2015-04-03T21:54:00Z","updated_at":"2015-04-04T11:18:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"84819081c0f8a23d444b97f89cfaa9e85c540d1c","assignee":{"login":"krzyk","id":105730,"avatar_url":"https://avatars.githubusercontent.com/u/105730?v=3","gravatar_id":"","url":"https://api.github.com/users/krzyk","html_url":"https://github.com/krzyk","followers_url":"https://api.github.com/users/krzyk/followers","following_url":"https://api.github.com/users/krzyk/following{/other_user}","gists_url":"https://api.github.com/users/krzyk/gists{/gist_id}","starred_url":"https://api.github.com/users/krzyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krzyk/subscriptions","organizations_url":"https://api.github.com/users/krzyk/orgs","repos_url":"https://api.github.com/users/krzyk/repos","events_url":"https://api.github.com/users/krzyk/events{/privacy}","received_events_url":"https://api.github.com/users/krzyk/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/teamed/nerodesk/pulls/181/commits","review_comments_url":"https://api.github.com/repos/teamed/nerodesk/pulls/181/comments","review_comment_url":"https://api.github.com/repos/teamed/nerodesk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/teamed/nerodesk/issues/181/comments","statuses_url":"https://api.github.com/repos/teamed/nerodesk/statuses/a18e812230692a52e68cc9d49ed854908abad574","head":{"label":"caarlos0:156","ref":"156","sha":"a18e812230692a52e68cc9d49ed854908abad574","user":{"login":"caarlos0","id":245435,"avatar_url":"https://avatars.githubusercontent.com/u/245435?v=3","gravatar_id":"","url":"https://api.github.com/users/caarlos0","html_url":"https://github.com/caarlos0","followers_url":"https://api.github.com/users/caarlos0/followers","following_url":"https://api.github.com/users/caarlos0/following{/other_user}","gists_url":"https://api.github.com/users/caarlos0/gists{/gist_id}","starred_url":"https://api.github.com/users/caarlos0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caarlos0/subscriptions","organizations_url":"https://api.github.com/users/caarlos0/orgs","repos_url":"https://api.github.com/users/caarlos0/repos","events_url":"https://api.github.com/users/caarlos0/events{/privacy}","received_events_url":"https://api.github.com/users/caarlos0/received_events","type":"User","site_admin":false},"repo":{"id":32611872,"name":"nerodesk","full_name":"caarlos0/nerodesk","owner":{"login":"caarlos0","id":245435,"avatar_url":"https://avatars.githubusercontent.com/u/245435?v=3","gravatar_id":"","url":"https://api.github.com/users/caarlos0","html_url":"https://github.com/caarlos0","followers_url":"https://api.github.com/users/caarlos0/followers","following_url":"https://api.github.com/users/caarlos0/following{/other_user}","gists_url":"https://api.github.com/users/caarlos0/gists{/gist_id}","starred_url":"https://api.github.com/users/caarlos0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caarlos0/subscriptions","organizations_url":"https://api.github.com/users/caarlos0/orgs","repos_url":"https://api.github.com/users/caarlos0/repos","events_url":"https://api.github.com/users/caarlos0/events{/privacy}","received_events_url":"https://api.github.com/users/caarlos0/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/caarlos0/nerodesk","description":"cloud file sharing service","fork":true,"url":"https://api.github.com/repos/caarlos0/nerodesk","forks_url":"https://api.github.com/repos/caarlos0/nerodesk/forks","keys_url":"https://api.github.com/repos/caarlos0/nerodesk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/caarlos0/nerodesk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/caarlos0/nerodesk/teams","hooks_url":"https://api.github.com/repos/caarlos0/nerodesk/hooks","issue_events_url":"https://api.github.com/repos/caarlos0/nerodesk/issues/events{/number}","events_url":"https://api.github.com/repos/caarlos0/nerodesk/events","assignees_url":"https://api.github.com/repos/caarlos0/nerodesk/assignees{/user}","branches_url":"https://api.github.com/repos/caarlos0/nerodesk/branches{/branch}","tags_url":"https://api.github.com/repos/caarlos0/nerodesk/tags","blobs_url":"https://api.github.com/repos/caarlos0/nerodesk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/caarlos0/nerodesk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/caarlos0/nerodesk/git/refs{/sha}","trees_url":"https://api.github.com/repos/caarlos0/nerodesk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/caarlos0/nerodesk/statuses/{sha}","languages_url":"https://api.github.com/repos/caarlos0/nerodesk/languages","stargazers_url":"https://api.github.com/repos/caarlos0/nerodesk/stargazers","contributors_url":"https://api.github.com/repos/caarlos0/nerodesk/contributors","subscribers_url":"https://api.github.com/repos/caarlos0/nerodesk/subscribers","subscription_url":"https://api.github.com/repos/caarlos0/nerodesk/subscription","commits_url":"https://api.github.com/repos/caarlos0/nerodesk/commits{/sha}","git_commits_url":"https://api.github.com/repos/caarlos0/nerodesk/git/commits{/sha}","comments_url":"https://api.github.com/repos/caarlos0/nerodesk/comments{/number}","issue_comment_url":"https://api.github.com/repos/caarlos0/nerodesk/issues/comments{/number}","contents_url":"https://api.github.com/repos/caarlos0/nerodesk/contents/{+path}","compare_url":"https://api.github.com/repos/caarlos0/nerodesk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/caarlos0/nerodesk/merges","archive_url":"https://api.github.com/repos/caarlos0/nerodesk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/caarlos0/nerodesk/downloads","issues_url":"https://api.github.com/repos/caarlos0/nerodesk/issues{/number}","pulls_url":"https://api.github.com/repos/caarlos0/nerodesk/pulls{/number}","milestones_url":"https://api.github.com/repos/caarlos0/nerodesk/milestones{/number}","notifications_url":"https://api.github.com/repos/caarlos0/nerodesk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/caarlos0/nerodesk/labels{/name}","releases_url":"https://api.github.com/repos/caarlos0/nerodesk/releases{/id}","created_at":"2015-03-20T23:14:55Z","updated_at":"2015-04-03T20:20:42Z","pushed_at":"2015-04-03T23:51:31Z","git_url":"git://github.com/caarlos0/nerodesk.git","ssh_url":"git@github.com:caarlos0/nerodesk.git","clone_url":"https://github.com/caarlos0/nerodesk.git","svn_url":"https://github.com/caarlos0/nerodesk","homepage":"http://www.nerodesk.com","size":879,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"teamed:master","ref":"master","sha":"7ec07fcd67576ba2ea14e048bbb0cd108c3e6b58","user":{"login":"teamed","id":7436563,"avatar_url":"https://avatars.githubusercontent.com/u/7436563?v=3","gravatar_id":"","url":"https://api.github.com/users/teamed","html_url":"https://github.com/teamed","followers_url":"https://api.github.com/users/teamed/followers","following_url":"https://api.github.com/users/teamed/following{/other_user}","gists_url":"https://api.github.com/users/teamed/gists{/gist_id}","starred_url":"https://api.github.com/users/teamed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teamed/subscriptions","organizations_url":"https://api.github.com/users/teamed/orgs","repos_url":"https://api.github.com/users/teamed/repos","events_url":"https://api.github.com/users/teamed/events{/privacy}","received_events_url":"https://api.github.com/users/teamed/received_events","type":"Organization","site_admin":false},"repo":{"id":30859333,"name":"nerodesk","full_name":"teamed/nerodesk","owner":{"login":"teamed","id":7436563,"avatar_url":"https://avatars.githubusercontent.com/u/7436563?v=3","gravatar_id":"","url":"https://api.github.com/users/teamed","html_url":"https://github.com/teamed","followers_url":"https://api.github.com/users/teamed/followers","following_url":"https://api.github.com/users/teamed/following{/other_user}","gists_url":"https://api.github.com/users/teamed/gists{/gist_id}","starred_url":"https://api.github.com/users/teamed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teamed/subscriptions","organizations_url":"https://api.github.com/users/teamed/orgs","repos_url":"https://api.github.com/users/teamed/repos","events_url":"https://api.github.com/users/teamed/events{/privacy}","received_events_url":"https://api.github.com/users/teamed/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/teamed/nerodesk","description":"cloud file sharing service","fork":false,"url":"https://api.github.com/repos/teamed/nerodesk","forks_url":"https://api.github.com/repos/teamed/nerodesk/forks","keys_url":"https://api.github.com/repos/teamed/nerodesk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/teamed/nerodesk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/teamed/nerodesk/teams","hooks_url":"https://api.github.com/repos/teamed/nerodesk/hooks","issue_events_url":"https://api.github.com/repos/teamed/nerodesk/issues/events{/number}","events_url":"https://api.github.com/repos/teamed/nerodesk/events","assignees_url":"https://api.github.com/repos/teamed/nerodesk/assignees{/user}","branches_url":"https://api.github.com/repos/teamed/nerodesk/branches{/branch}","tags_url":"https://api.github.com/repos/teamed/nerodesk/tags","blobs_url":"https://api.github.com/repos/teamed/nerodesk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/teamed/nerodesk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/teamed/nerodesk/git/refs{/sha}","trees_url":"https://api.github.com/repos/teamed/nerodesk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/teamed/nerodesk/statuses/{sha}","languages_url":"https://api.github.com/repos/teamed/nerodesk/languages","stargazers_url":"https://api.github.com/repos/teamed/nerodesk/stargazers","contributors_url":"https://api.github.com/repos/teamed/nerodesk/contributors","subscribers_url":"https://api.github.com/repos/teamed/nerodesk/subscribers","subscription_url":"https://api.github.com/repos/teamed/nerodesk/subscription","commits_url":"https://api.github.com/repos/teamed/nerodesk/commits{/sha}","git_commits_url":"https://api.github.com/repos/teamed/nerodesk/git/commits{/sha}","comments_url":"https://api.github.com/repos/teamed/nerodesk/comments{/number}","issue_comment_url":"https://api.github.com/repos/teamed/nerodesk/issues/comments{/number}","contents_url":"https://api.github.com/repos/teamed/nerodesk/contents/{+path}","compare_url":"https://api.github.com/repos/teamed/nerodesk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/teamed/nerodesk/merges","archive_url":"https://api.github.com/repos/teamed/nerodesk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/teamed/nerodesk/downloads","issues_url":"https://api.github.com/repos/teamed/nerodesk/issues{/number}","pulls_url":"https://api.github.com/repos/teamed/nerodesk/pulls{/number}","milestones_url":"https://api.github.com/repos/teamed/nerodesk/milestones{/number}","notifications_url":"https://api.github.com/repos/teamed/nerodesk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/teamed/nerodesk/labels{/name}","releases_url":"https://api.github.com/repos/teamed/nerodesk/releases{/id}","created_at":"2015-02-16T08:15:02Z","updated_at":"2015-04-02T21:20:14Z","pushed_at":"2015-04-04T07:40:48Z","git_url":"git://github.com/teamed/nerodesk.git","ssh_url":"git@github.com:teamed/nerodesk.git","clone_url":"https://github.com/teamed/nerodesk.git","svn_url":"https://github.com/teamed/nerodesk","homepage":"http://www.nerodesk.com","size":2936,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":10,"mirror_url":null,"open_issues_count":42,"forks":10,"open_issues":42,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/teamed/nerodesk/pulls/181"},"html":{"href":"https://github.com/teamed/nerodesk/pull/181"},"issue":{"href":"https://api.github.com/repos/teamed/nerodesk/issues/181"},"comments":{"href":"https://api.github.com/repos/teamed/nerodesk/issues/181/comments"},"review_comments":{"href":"https://api.github.com/repos/teamed/nerodesk/pulls/181/comments"},"review_comment":{"href":"https://api.github.com/repos/teamed/nerodesk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/teamed/nerodesk/pulls/181/commits"},"statuses":{"href":"https://api.github.com/repos/teamed/nerodesk/statuses/a18e812230692a52e68cc9d49ed854908abad574"}}}}