{"action":"created","comment":{"url":"https://api.github.com/repos/DorsetProject/dorset-framework/pulls/comments/93095793","pull_request_review_id":13617434,"id":93095793,"diff_hunk":"@@ -0,0 +1,139 @@\n+/*\n+ * Copyright 2016 The Johns Hopkins University Applied Physics Laboratory LLC\n+ * All rights reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * 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+\n+package edu.jhuapl.dorset.fileuserservice;\n+\n+import java.io.File;\n+import java.io.FileInputStream;\n+import java.io.FileOutputStream;\n+import java.io.IOException;\n+import java.io.OutputStream;\n+import java.util.Enumeration;\n+import java.util.HashMap;\n+import java.util.Map;\n+import java.util.Properties;\n+import java.util.Set;\n+\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+import edu.jhuapl.dorset.users.User;\n+import edu.jhuapl.dorset.users.UserException;\n+import edu.jhuapl.dorset.users.UserService;\n+\n+public class FileUserService implements UserService {\n+    private static final Logger logger = LoggerFactory.getLogger(FileUserService.class);\n+\n+    private Map<String, User> users;\n+    protected String userDirPath;\n+    protected String fileBaseName;\n+\n+    /**\n+     * \n+     * FileUserService\n+     * \n+     * @param userDirectoryPath Path to directory that contains User files\n+     * @param fileBaseName Base string of User file names\n+     */\n+    public FileUserService(String userDirectoryPath, String fileBaseName) {\n+        users = new HashMap<String, User>();\n+        this.userDirPath = userDirectoryPath;\n+        this.fileBaseName = fileBaseName;\n+    }\n+\n+    @Override\n+    public String create(User user) throws UserException {\n+        Properties prop = new Properties();\n+        OutputStream output = null;\n+        String userFilePath = this.userDirPath + this.fileBaseName + \"-\" + user.getUserName()","path":"components/user-service/src/main/java/edu/jhuapl/dorset/fileuserservice/FileUserService.java","position":null,"original_position":62,"commit_id":"dec3529679e585648775031103c1f2a9542959a0","original_commit_id":"0890d6f264003202802debc15bd97d2e118df359","user":{"login":"cabishop","id":10614936,"avatar_url":"https://avatars.githubusercontent.com/u/10614936?v=3","gravatar_id":"","url":"https://api.github.com/users/cabishop","html_url":"https://github.com/cabishop","followers_url":"https://api.github.com/users/cabishop/followers","following_url":"https://api.github.com/users/cabishop/following{/other_user}","gists_url":"https://api.github.com/users/cabishop/gists{/gist_id}","starred_url":"https://api.github.com/users/cabishop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cabishop/subscriptions","organizations_url":"https://api.github.com/users/cabishop/orgs","repos_url":"https://api.github.com/users/cabishop/repos","events_url":"https://api.github.com/users/cabishop/events{/privacy}","received_events_url":"https://api.github.com/users/cabishop/received_events","type":"User","site_admin":false},"body":"@cash Do you think that I should check if the directory exists on instantiation of the constructor?","created_at":"2016-12-19T18:56:58Z","updated_at":"2016-12-19T18:56:58Z","html_url":"https://github.com/DorsetProject/dorset-framework/pull/58#discussion_r93095793","pull_request_url":"https://api.github.com/repos/DorsetProject/dorset-framework/pulls/58","_links":{"self":{"href":"https://api.github.com/repos/DorsetProject/dorset-framework/pulls/comments/93095793"},"html":{"href":"https://github.com/DorsetProject/dorset-framework/pull/58#discussion_r93095793"},"pull_request":{"href":"https://api.github.com/repos/DorsetProject/dorset-framework/pulls/58"}}},"pull_request":{"url":"https://api.github.com/repos/DorsetProject/dorset-framework/pulls/58","id":94831764,"html_url":"https://github.com/DorsetProject/dorset-framework/pull/58","diff_url":"https://github.com/DorsetProject/dorset-framework/pull/58.diff","patch_url":"https://github.com/DorsetProject/dorset-framework/pull/58.patch","issue_url":"https://api.github.com/repos/DorsetProject/dorset-framework/issues/58","number":58,"state":"open","locked":false,"title":"User accounts","user":{"login":"cabishop","id":10614936,"avatar_url":"https://avatars.githubusercontent.com/u/10614936?v=3","gravatar_id":"","url":"https://api.github.com/users/cabishop","html_url":"https://github.com/cabishop","followers_url":"https://api.github.com/users/cabishop/followers","following_url":"https://api.github.com/users/cabishop/following{/other_user}","gists_url":"https://api.github.com/users/cabishop/gists{/gist_id}","starred_url":"https://api.github.com/users/cabishop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cabishop/subscriptions","organizations_url":"https://api.github.com/users/cabishop/orgs","repos_url":"https://api.github.com/users/cabishop/repos","events_url":"https://api.github.com/users/cabishop/events{/privacy}","received_events_url":"https://api.github.com/users/cabishop/received_events","type":"User","site_admin":false},"body":"Implementation of User Accounts into the Dorset Framework. Simple CsvFileUserService added to components as an initial example of a UserService.  ","created_at":"2016-11-22T15:07:39Z","updated_at":"2016-12-19T18:56:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9c3cdba80505b67efdd2caa21169eedc0edd2558","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/DorsetProject/dorset-framework/pulls/58/commits","review_comments_url":"https://api.github.com/repos/DorsetProject/dorset-framework/pulls/58/comments","review_comment_url":"https://api.github.com/repos/DorsetProject/dorset-framework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DorsetProject/dorset-framework/issues/58/comments","statuses_url":"https://api.github.com/repos/DorsetProject/dorset-framework/statuses/dec3529679e585648775031103c1f2a9542959a0","head":{"label":"cabishop:user_accounts","ref":"user_accounts","sha":"dec3529679e585648775031103c1f2a9542959a0","user":{"login":"cabishop","id":10614936,"avatar_url":"https://avatars.githubusercontent.com/u/10614936?v=3","gravatar_id":"","url":"https://api.github.com/users/cabishop","html_url":"https://github.com/cabishop","followers_url":"https://api.github.com/users/cabishop/followers","following_url":"https://api.github.com/users/cabishop/following{/other_user}","gists_url":"https://api.github.com/users/cabishop/gists{/gist_id}","starred_url":"https://api.github.com/users/cabishop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cabishop/subscriptions","organizations_url":"https://api.github.com/users/cabishop/orgs","repos_url":"https://api.github.com/users/cabishop/repos","events_url":"https://api.github.com/users/cabishop/events{/privacy}","received_events_url":"https://api.github.com/users/cabishop/received_events","type":"User","site_admin":false},"repo":{"id":50513104,"name":"dorset-framework","full_name":"cabishop/dorset-framework","owner":{"login":"cabishop","id":10614936,"avatar_url":"https://avatars.githubusercontent.com/u/10614936?v=3","gravatar_id":"","url":"https://api.github.com/users/cabishop","html_url":"https://github.com/cabishop","followers_url":"https://api.github.com/users/cabishop/followers","following_url":"https://api.github.com/users/cabishop/following{/other_user}","gists_url":"https://api.github.com/users/cabishop/gists{/gist_id}","starred_url":"https://api.github.com/users/cabishop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cabishop/subscriptions","organizations_url":"https://api.github.com/users/cabishop/orgs","repos_url":"https://api.github.com/users/cabishop/repos","events_url":"https://api.github.com/users/cabishop/events{/privacy}","received_events_url":"https://api.github.com/users/cabishop/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cabishop/dorset-framework","description":"A framework for creating intelligent virtual assistants","fork":true,"url":"https://api.github.com/repos/cabishop/dorset-framework","forks_url":"https://api.github.com/repos/cabishop/dorset-framework/forks","keys_url":"https://api.github.com/repos/cabishop/dorset-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cabishop/dorset-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cabishop/dorset-framework/teams","hooks_url":"https://api.github.com/repos/cabishop/dorset-framework/hooks","issue_events_url":"https://api.github.com/repos/cabishop/dorset-framework/issues/events{/number}","events_url":"https://api.github.com/repos/cabishop/dorset-framework/events","assignees_url":"https://api.github.com/repos/cabishop/dorset-framework/assignees{/user}","branches_url":"https://api.github.com/repos/cabishop/dorset-framework/branches{/branch}","tags_url":"https://api.github.com/repos/cabishop/dorset-framework/tags","blobs_url":"https://api.github.com/repos/cabishop/dorset-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cabishop/dorset-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cabishop/dorset-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/cabishop/dorset-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cabishop/dorset-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/cabishop/dorset-framework/languages","stargazers_url":"https://api.github.com/repos/cabishop/dorset-framework/stargazers","contributors_url":"https://api.github.com/repos/cabishop/dorset-framework/contributors","subscribers_url":"https://api.github.com/repos/cabishop/dorset-framework/subscribers","subscription_url":"https://api.github.com/repos/cabishop/dorset-framework/subscription","commits_url":"https://api.github.com/repos/cabishop/dorset-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/cabishop/dorset-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/cabishop/dorset-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/cabishop/dorset-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/cabishop/dorset-framework/contents/{+path}","compare_url":"https://api.github.com/repos/cabishop/dorset-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cabishop/dorset-framework/merges","archive_url":"https://api.github.com/repos/cabishop/dorset-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cabishop/dorset-framework/downloads","issues_url":"https://api.github.com/repos/cabishop/dorset-framework/issues{/number}","pulls_url":"https://api.github.com/repos/cabishop/dorset-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/cabishop/dorset-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/cabishop/dorset-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cabishop/dorset-framework/labels{/name}","releases_url":"https://api.github.com/repos/cabishop/dorset-framework/releases{/id}","deployments_url":"https://api.github.com/repos/cabishop/dorset-framework/deployments","created_at":"2016-01-27T14:32:10Z","updated_at":"2016-01-27T14:32:11Z","pushed_at":"2016-12-19T18:50:52Z","git_url":"git://github.com/cabishop/dorset-framework.git","ssh_url":"git@github.com:cabishop/dorset-framework.git","clone_url":"https://github.com/cabishop/dorset-framework.git","svn_url":"https://github.com/cabishop/dorset-framework","homepage":null,"size":1431,"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":"DorsetProject:master","ref":"master","sha":"a8b81f6536f455d41e3e97eada22f5b7607b6b42","user":{"login":"DorsetProject","id":16415993,"avatar_url":"https://avatars.githubusercontent.com/u/16415993?v=3","gravatar_id":"","url":"https://api.github.com/users/DorsetProject","html_url":"https://github.com/DorsetProject","followers_url":"https://api.github.com/users/DorsetProject/followers","following_url":"https://api.github.com/users/DorsetProject/following{/other_user}","gists_url":"https://api.github.com/users/DorsetProject/gists{/gist_id}","starred_url":"https://api.github.com/users/DorsetProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DorsetProject/subscriptions","organizations_url":"https://api.github.com/users/DorsetProject/orgs","repos_url":"https://api.github.com/users/DorsetProject/repos","events_url":"https://api.github.com/users/DorsetProject/events{/privacy}","received_events_url":"https://api.github.com/users/DorsetProject/received_events","type":"Organization","site_admin":false},"repo":{"id":48804926,"name":"dorset-framework","full_name":"DorsetProject/dorset-framework","owner":{"login":"DorsetProject","id":16415993,"avatar_url":"https://avatars.githubusercontent.com/u/16415993?v=3","gravatar_id":"","url":"https://api.github.com/users/DorsetProject","html_url":"https://github.com/DorsetProject","followers_url":"https://api.github.com/users/DorsetProject/followers","following_url":"https://api.github.com/users/DorsetProject/following{/other_user}","gists_url":"https://api.github.com/users/DorsetProject/gists{/gist_id}","starred_url":"https://api.github.com/users/DorsetProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DorsetProject/subscriptions","organizations_url":"https://api.github.com/users/DorsetProject/orgs","repos_url":"https://api.github.com/users/DorsetProject/repos","events_url":"https://api.github.com/users/DorsetProject/events{/privacy}","received_events_url":"https://api.github.com/users/DorsetProject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DorsetProject/dorset-framework","description":"A framework for creating intelligent virtual assistants","fork":false,"url":"https://api.github.com/repos/DorsetProject/dorset-framework","forks_url":"https://api.github.com/repos/DorsetProject/dorset-framework/forks","keys_url":"https://api.github.com/repos/DorsetProject/dorset-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DorsetProject/dorset-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DorsetProject/dorset-framework/teams","hooks_url":"https://api.github.com/repos/DorsetProject/dorset-framework/hooks","issue_events_url":"https://api.github.com/repos/DorsetProject/dorset-framework/issues/events{/number}","events_url":"https://api.github.com/repos/DorsetProject/dorset-framework/events","assignees_url":"https://api.github.com/repos/DorsetProject/dorset-framework/assignees{/user}","branches_url":"https://api.github.com/repos/DorsetProject/dorset-framework/branches{/branch}","tags_url":"https://api.github.com/repos/DorsetProject/dorset-framework/tags","blobs_url":"https://api.github.com/repos/DorsetProject/dorset-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DorsetProject/dorset-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DorsetProject/dorset-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/DorsetProject/dorset-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DorsetProject/dorset-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/DorsetProject/dorset-framework/languages","stargazers_url":"https://api.github.com/repos/DorsetProject/dorset-framework/stargazers","contributors_url":"https://api.github.com/repos/DorsetProject/dorset-framework/contributors","subscribers_url":"https://api.github.com/repos/DorsetProject/dorset-framework/subscribers","subscription_url":"https://api.github.com/repos/DorsetProject/dorset-framework/subscription","commits_url":"https://api.github.com/repos/DorsetProject/dorset-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/DorsetProject/dorset-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/DorsetProject/dorset-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/DorsetProject/dorset-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/DorsetProject/dorset-framework/contents/{+path}","compare_url":"https://api.github.com/repos/DorsetProject/dorset-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DorsetProject/dorset-framework/merges","archive_url":"https://api.github.com/repos/DorsetProject/dorset-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DorsetProject/dorset-framework/downloads","issues_url":"https://api.github.com/repos/DorsetProject/dorset-framework/issues{/number}","pulls_url":"https://api.github.com/repos/DorsetProject/dorset-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/DorsetProject/dorset-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/DorsetProject/dorset-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DorsetProject/dorset-framework/labels{/name}","releases_url":"https://api.github.com/repos/DorsetProject/dorset-framework/releases{/id}","deployments_url":"https://api.github.com/repos/DorsetProject/dorset-framework/deployments","created_at":"2015-12-30T14:45:11Z","updated_at":"2016-11-18T04:18:31Z","pushed_at":"2016-12-19T18:50:54Z","git_url":"git://github.com/DorsetProject/dorset-framework.git","ssh_url":"git@github.com:DorsetProject/dorset-framework.git","clone_url":"https://github.com/DorsetProject/dorset-framework.git","svn_url":"https://github.com/DorsetProject/dorset-framework","homepage":null,"size":1407,"stargazers_count":6,"watchers_count":6,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":9,"forks":6,"open_issues":9,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DorsetProject/dorset-framework/pulls/58"},"html":{"href":"https://github.com/DorsetProject/dorset-framework/pull/58"},"issue":{"href":"https://api.github.com/repos/DorsetProject/dorset-framework/issues/58"},"comments":{"href":"https://api.github.com/repos/DorsetProject/dorset-framework/issues/58/comments"},"review_comments":{"href":"https://api.github.com/repos/DorsetProject/dorset-framework/pulls/58/comments"},"review_comment":{"href":"https://api.github.com/repos/DorsetProject/dorset-framework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DorsetProject/dorset-framework/pulls/58/commits"},"statuses":{"href":"https://api.github.com/repos/DorsetProject/dorset-framework/statuses/dec3529679e585648775031103c1f2a9542959a0"}}}}
{"actor":{"display_login":"cabishop"}}