{"action":"created","comment":{"url":"https://api.github.com/repos/se-edu/addressbook-level1/pulls/comments/92328101","pull_request_review_id":12840665,"id":92328101,"diff_hunk":"@@ -305,12 +306,40 @@ private static void setupDefaultFileForStorage() {\n     }\n \n     /**\n-     * Returns true if the given file is acceptable.\n-     * The file path is acceptable if it ends in '.txt'\n-     * TODO: Implement a more rigorous validity checking.\n+     * Returns true if the given file path is acceptable.\n+     * The file path is acceptable if it has a folder that exists,\n+     * has a file name that is acceptable to the OS,\n+     * File name must also contain an extension\n      */\n     private static boolean isValidFilePath(String filePath) {\n-        return filePath.endsWith(\".txt\");\n+        if (filePath == null) {\n+            return false;\n+        }\n+        File filePathToValidate = new File(filePath);\n+        return hasValidFileName(filePathToValidate) && hasValidFolder(filePathToValidate);\n+    }\n+\n+    /**\n+     * Returns true if the file path has a folder that exists\n+     */\n+    private static boolean hasValidFolder(File filePath) {\n+        File folderToValidate = filePath.getAbsoluteFile().getParentFile();\n+        return folderToValidate.exists();","path":"src/seedu/addressbook/AddressBook.java","position":34,"original_position":34,"commit_id":"19cdda115e2b679460edba6e6191cd4e3887e155","original_commit_id":"19cdda115e2b679460edba6e6191cd4e3887e155","user":{"login":"brandonyeoxg","id":16134861,"avatar_url":"https://avatars.githubusercontent.com/u/16134861?v=3","gravatar_id":"","url":"https://api.github.com/users/brandonyeoxg","html_url":"https://github.com/brandonyeoxg","followers_url":"https://api.github.com/users/brandonyeoxg/followers","following_url":"https://api.github.com/users/brandonyeoxg/following{/other_user}","gists_url":"https://api.github.com/users/brandonyeoxg/gists{/gist_id}","starred_url":"https://api.github.com/users/brandonyeoxg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandonyeoxg/subscriptions","organizations_url":"https://api.github.com/users/brandonyeoxg/orgs","repos_url":"https://api.github.com/users/brandonyeoxg/repos","events_url":"https://api.github.com/users/brandonyeoxg/events{/privacy}","received_events_url":"https://api.github.com/users/brandonyeoxg/received_events","type":"User","site_admin":false},"body":"Ooo got it.","created_at":"2016-12-14T06:14:24Z","updated_at":"2016-12-14T06:14:24Z","html_url":"https://github.com/se-edu/addressbook-level1/pull/56#discussion_r92328101","pull_request_url":"https://api.github.com/repos/se-edu/addressbook-level1/pulls/56","_links":{"self":{"href":"https://api.github.com/repos/se-edu/addressbook-level1/pulls/comments/92328101"},"html":{"href":"https://github.com/se-edu/addressbook-level1/pull/56#discussion_r92328101"},"pull_request":{"href":"https://api.github.com/repos/se-edu/addressbook-level1/pulls/56"}}},"pull_request":{"url":"https://api.github.com/repos/se-edu/addressbook-level1/pulls/56","id":96078402,"html_url":"https://github.com/se-edu/addressbook-level1/pull/56","diff_url":"https://github.com/se-edu/addressbook-level1/pull/56.diff","patch_url":"https://github.com/se-edu/addressbook-level1/pull/56.patch","issue_url":"https://api.github.com/repos/se-edu/addressbook-level1/issues/56","number":56,"state":"open","locked":false,"title":"Implement a more rigorous validity check for file path #55","user":{"login":"brandonyeoxg","id":16134861,"avatar_url":"https://avatars.githubusercontent.com/u/16134861?v=3","gravatar_id":"","url":"https://api.github.com/users/brandonyeoxg","html_url":"https://github.com/brandonyeoxg","followers_url":"https://api.github.com/users/brandonyeoxg/followers","following_url":"https://api.github.com/users/brandonyeoxg/following{/other_user}","gists_url":"https://api.github.com/users/brandonyeoxg/gists{/gist_id}","starred_url":"https://api.github.com/users/brandonyeoxg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandonyeoxg/subscriptions","organizations_url":"https://api.github.com/users/brandonyeoxg/orgs","repos_url":"https://api.github.com/users/brandonyeoxg/repos","events_url":"https://api.github.com/users/brandonyeoxg/events{/privacy}","received_events_url":"https://api.github.com/users/brandonyeoxg/received_events","type":"User","site_admin":false},"body":"ready for review.","created_at":"2016-12-01T12:18:56Z","updated_at":"2016-12-14T06:14:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2a6ebb14f6402eff41f29c690ea19a63d8a38d4c","assignee":{"login":"pyokagan","id":109479,"avatar_url":"https://avatars.githubusercontent.com/u/109479?v=3","gravatar_id":"","url":"https://api.github.com/users/pyokagan","html_url":"https://github.com/pyokagan","followers_url":"https://api.github.com/users/pyokagan/followers","following_url":"https://api.github.com/users/pyokagan/following{/other_user}","gists_url":"https://api.github.com/users/pyokagan/gists{/gist_id}","starred_url":"https://api.github.com/users/pyokagan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyokagan/subscriptions","organizations_url":"https://api.github.com/users/pyokagan/orgs","repos_url":"https://api.github.com/users/pyokagan/repos","events_url":"https://api.github.com/users/pyokagan/events{/privacy}","received_events_url":"https://api.github.com/users/pyokagan/received_events","type":"User","site_admin":false},"assignees":[{"login":"pyokagan","id":109479,"avatar_url":"https://avatars.githubusercontent.com/u/109479?v=3","gravatar_id":"","url":"https://api.github.com/users/pyokagan","html_url":"https://github.com/pyokagan","followers_url":"https://api.github.com/users/pyokagan/followers","following_url":"https://api.github.com/users/pyokagan/following{/other_user}","gists_url":"https://api.github.com/users/pyokagan/gists{/gist_id}","starred_url":"https://api.github.com/users/pyokagan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyokagan/subscriptions","organizations_url":"https://api.github.com/users/pyokagan/orgs","repos_url":"https://api.github.com/users/pyokagan/repos","events_url":"https://api.github.com/users/pyokagan/events{/privacy}","received_events_url":"https://api.github.com/users/pyokagan/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/se-edu/addressbook-level1/pulls/56/commits","review_comments_url":"https://api.github.com/repos/se-edu/addressbook-level1/pulls/56/comments","review_comment_url":"https://api.github.com/repos/se-edu/addressbook-level1/pulls/comments{/number}","comments_url":"https://api.github.com/repos/se-edu/addressbook-level1/issues/56/comments","statuses_url":"https://api.github.com/repos/se-edu/addressbook-level1/statuses/19cdda115e2b679460edba6e6191cd4e3887e155","head":{"label":"brandonyeoxg:55-implement-more-rigorous-validity-check-file-path","ref":"55-implement-more-rigorous-validity-check-file-path","sha":"19cdda115e2b679460edba6e6191cd4e3887e155","user":{"login":"brandonyeoxg","id":16134861,"avatar_url":"https://avatars.githubusercontent.com/u/16134861?v=3","gravatar_id":"","url":"https://api.github.com/users/brandonyeoxg","html_url":"https://github.com/brandonyeoxg","followers_url":"https://api.github.com/users/brandonyeoxg/followers","following_url":"https://api.github.com/users/brandonyeoxg/following{/other_user}","gists_url":"https://api.github.com/users/brandonyeoxg/gists{/gist_id}","starred_url":"https://api.github.com/users/brandonyeoxg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandonyeoxg/subscriptions","organizations_url":"https://api.github.com/users/brandonyeoxg/orgs","repos_url":"https://api.github.com/users/brandonyeoxg/repos","events_url":"https://api.github.com/users/brandonyeoxg/events{/privacy}","received_events_url":"https://api.github.com/users/brandonyeoxg/received_events","type":"User","site_admin":false},"repo":{"id":75270431,"name":"addressbook-level1","full_name":"brandonyeoxg/addressbook-level1","owner":{"login":"brandonyeoxg","id":16134861,"avatar_url":"https://avatars.githubusercontent.com/u/16134861?v=3","gravatar_id":"","url":"https://api.github.com/users/brandonyeoxg","html_url":"https://github.com/brandonyeoxg","followers_url":"https://api.github.com/users/brandonyeoxg/followers","following_url":"https://api.github.com/users/brandonyeoxg/following{/other_user}","gists_url":"https://api.github.com/users/brandonyeoxg/gists{/gist_id}","starred_url":"https://api.github.com/users/brandonyeoxg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandonyeoxg/subscriptions","organizations_url":"https://api.github.com/users/brandonyeoxg/orgs","repos_url":"https://api.github.com/users/brandonyeoxg/repos","events_url":"https://api.github.com/users/brandonyeoxg/events{/privacy}","received_events_url":"https://api.github.com/users/brandonyeoxg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/brandonyeoxg/addressbook-level1","description":"A Java sample application for students. An AddressBook application written in procedural fashion.","fork":true,"url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1","forks_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/forks","keys_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/teams","hooks_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/hooks","issue_events_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/issues/events{/number}","events_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/events","assignees_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/assignees{/user}","branches_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/branches{/branch}","tags_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/tags","blobs_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/git/refs{/sha}","trees_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/statuses/{sha}","languages_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/languages","stargazers_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/stargazers","contributors_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/contributors","subscribers_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/subscribers","subscription_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/subscription","commits_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/commits{/sha}","git_commits_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/git/commits{/sha}","comments_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/comments{/number}","issue_comment_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/issues/comments{/number}","contents_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/contents/{+path}","compare_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/merges","archive_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/downloads","issues_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/issues{/number}","pulls_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/pulls{/number}","milestones_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/milestones{/number}","notifications_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/labels{/name}","releases_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/releases{/id}","deployments_url":"https://api.github.com/repos/brandonyeoxg/addressbook-level1/deployments","created_at":"2016-12-01T08:13:19Z","updated_at":"2016-12-01T08:13:20Z","pushed_at":"2016-12-13T06:16:21Z","git_url":"git://github.com/brandonyeoxg/addressbook-level1.git","ssh_url":"git@github.com:brandonyeoxg/addressbook-level1.git","clone_url":"https://github.com/brandonyeoxg/addressbook-level1.git","svn_url":"https://github.com/brandonyeoxg/addressbook-level1","homepage":null,"size":2538,"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":"se-edu:master","ref":"master","sha":"24f72417815023aa7459fdab4620c95d0e6313fc","user":{"login":"se-edu","id":20763652,"avatar_url":"https://avatars.githubusercontent.com/u/20763652?v=3","gravatar_id":"","url":"https://api.github.com/users/se-edu","html_url":"https://github.com/se-edu","followers_url":"https://api.github.com/users/se-edu/followers","following_url":"https://api.github.com/users/se-edu/following{/other_user}","gists_url":"https://api.github.com/users/se-edu/gists{/gist_id}","starred_url":"https://api.github.com/users/se-edu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/se-edu/subscriptions","organizations_url":"https://api.github.com/users/se-edu/orgs","repos_url":"https://api.github.com/users/se-edu/repos","events_url":"https://api.github.com/users/se-edu/events{/privacy}","received_events_url":"https://api.github.com/users/se-edu/received_events","type":"Organization","site_admin":false},"repo":{"id":63932534,"name":"addressbook-level1","full_name":"se-edu/addressbook-level1","owner":{"login":"se-edu","id":20763652,"avatar_url":"https://avatars.githubusercontent.com/u/20763652?v=3","gravatar_id":"","url":"https://api.github.com/users/se-edu","html_url":"https://github.com/se-edu","followers_url":"https://api.github.com/users/se-edu/followers","following_url":"https://api.github.com/users/se-edu/following{/other_user}","gists_url":"https://api.github.com/users/se-edu/gists{/gist_id}","starred_url":"https://api.github.com/users/se-edu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/se-edu/subscriptions","organizations_url":"https://api.github.com/users/se-edu/orgs","repos_url":"https://api.github.com/users/se-edu/repos","events_url":"https://api.github.com/users/se-edu/events{/privacy}","received_events_url":"https://api.github.com/users/se-edu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/se-edu/addressbook-level1","description":"A Java sample application for students. An AddressBook application written in procedural fashion.","fork":false,"url":"https://api.github.com/repos/se-edu/addressbook-level1","forks_url":"https://api.github.com/repos/se-edu/addressbook-level1/forks","keys_url":"https://api.github.com/repos/se-edu/addressbook-level1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/se-edu/addressbook-level1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/se-edu/addressbook-level1/teams","hooks_url":"https://api.github.com/repos/se-edu/addressbook-level1/hooks","issue_events_url":"https://api.github.com/repos/se-edu/addressbook-level1/issues/events{/number}","events_url":"https://api.github.com/repos/se-edu/addressbook-level1/events","assignees_url":"https://api.github.com/repos/se-edu/addressbook-level1/assignees{/user}","branches_url":"https://api.github.com/repos/se-edu/addressbook-level1/branches{/branch}","tags_url":"https://api.github.com/repos/se-edu/addressbook-level1/tags","blobs_url":"https://api.github.com/repos/se-edu/addressbook-level1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/se-edu/addressbook-level1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/se-edu/addressbook-level1/git/refs{/sha}","trees_url":"https://api.github.com/repos/se-edu/addressbook-level1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/se-edu/addressbook-level1/statuses/{sha}","languages_url":"https://api.github.com/repos/se-edu/addressbook-level1/languages","stargazers_url":"https://api.github.com/repos/se-edu/addressbook-level1/stargazers","contributors_url":"https://api.github.com/repos/se-edu/addressbook-level1/contributors","subscribers_url":"https://api.github.com/repos/se-edu/addressbook-level1/subscribers","subscription_url":"https://api.github.com/repos/se-edu/addressbook-level1/subscription","commits_url":"https://api.github.com/repos/se-edu/addressbook-level1/commits{/sha}","git_commits_url":"https://api.github.com/repos/se-edu/addressbook-level1/git/commits{/sha}","comments_url":"https://api.github.com/repos/se-edu/addressbook-level1/comments{/number}","issue_comment_url":"https://api.github.com/repos/se-edu/addressbook-level1/issues/comments{/number}","contents_url":"https://api.github.com/repos/se-edu/addressbook-level1/contents/{+path}","compare_url":"https://api.github.com/repos/se-edu/addressbook-level1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/se-edu/addressbook-level1/merges","archive_url":"https://api.github.com/repos/se-edu/addressbook-level1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/se-edu/addressbook-level1/downloads","issues_url":"https://api.github.com/repos/se-edu/addressbook-level1/issues{/number}","pulls_url":"https://api.github.com/repos/se-edu/addressbook-level1/pulls{/number}","milestones_url":"https://api.github.com/repos/se-edu/addressbook-level1/milestones{/number}","notifications_url":"https://api.github.com/repos/se-edu/addressbook-level1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/se-edu/addressbook-level1/labels{/name}","releases_url":"https://api.github.com/repos/se-edu/addressbook-level1/releases{/id}","deployments_url":"https://api.github.com/repos/se-edu/addressbook-level1/deployments","created_at":"2016-07-22T07:20:33Z","updated_at":"2016-12-09T06:31:00Z","pushed_at":"2016-12-13T06:16:22Z","git_url":"git://github.com/se-edu/addressbook-level1.git","ssh_url":"git@github.com:se-edu/addressbook-level1.git","clone_url":"https://github.com/se-edu/addressbook-level1.git","svn_url":"https://github.com/se-edu/addressbook-level1","homepage":null,"size":2749,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":232,"mirror_url":null,"open_issues_count":4,"forks":232,"open_issues":4,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/se-edu/addressbook-level1/pulls/56"},"html":{"href":"https://github.com/se-edu/addressbook-level1/pull/56"},"issue":{"href":"https://api.github.com/repos/se-edu/addressbook-level1/issues/56"},"comments":{"href":"https://api.github.com/repos/se-edu/addressbook-level1/issues/56/comments"},"review_comments":{"href":"https://api.github.com/repos/se-edu/addressbook-level1/pulls/56/comments"},"review_comment":{"href":"https://api.github.com/repos/se-edu/addressbook-level1/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/se-edu/addressbook-level1/pulls/56/commits"},"statuses":{"href":"https://api.github.com/repos/se-edu/addressbook-level1/statuses/19cdda115e2b679460edba6e6191cd4e3887e155"}}}}
{"actor":{"display_login":"brandonyeoxg"}}