{"action":"created","comment":{"url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/comments/23908729","id":23908729,"diff_hunk":"@@ -0,0 +1,200 @@\n+/*\n+ * To change this license header, choose License Headers in Project Properties.\n+ * To change this template file, choose Tools | Templates\n+ * and open the template in the editor.\n+ */\n+package ru.fizteh.fivt.students.AndrewTimokhin.FileMap.JUnit;\n+\n+import java.util.Set;\n+\n+/**\n+ *\n+ * @author Timokhin Andrew\n+ * \n+ */\n+public class InteractiveMode {\n+    \n+    static final String CREATE_COMMAND = \"create\";\n+    static final String PUT_COMMAND = \"put\";\n+    static final String GET_COMMAND = \"get\";\n+    static final String REMOVE_COMMAND = \"remove\";\n+    static final String DROP_COMMAND = \"drop\";\n+    static final String COMMIT_COMMAND = \"commit\";\n+    static final String ROLLBACK_COMMAND = \"rollback\";\n+    static final String USE_COMMAND = \"use\";\n+    static final String SIZE_COMMAND = \"size\";\n+    static final String LIST_COMMAND = \"list\";\n+    static final String EXIT_COMMAND = \"exit\";\n+    \n+    private TableImplement table;\n+    final TableProviderImplements provider;\n+    final FactoryImplements factory;\n+    String currentDir;\n+\n+    InteractiveMode(String path) {\n+        factory = new FactoryImplements();\n+        provider = (TableProviderImplements) factory.create(path);\n+        currentDir = null;\n+    }\n+\n+    private void invitationToRepeat() {\n+        System.out\n+                .println(\"Current command was not recognized or not complete. Please, try again\");\n+    }\n+\n+    boolean command(String textToParser) throws UnknownCommand,\n+            IllegalArgumentException, KeyNullAndNotFound {\n+        String[] commands = textToParser.trim().split(\" \");\n+        if (commands.length < 1)\n+            throw new UnknownCommand(\n+                    \"Current command was not recognized. Programm fail\");\n+        switch (commands[0]) {\n+        case CREATE_COMMAND:\n+            if (commands.length != 2) {\n+                this.invitationToRepeat();\n+                break;\n+            }\n+            if (provider.createTable(commands[1]) == null)\n+                System.out.println(\"Exist!\");\n+            else\n+                System.out.println(\"created\");\n+            break;\n+        case PUT_COMMAND:\n+            if (commands.length != 3) {\n+                this.invitationToRepeat();\n+                break;\n+            } else if (table == null) {\n+                System.out.println(\"No table\");","path":"src/ru/fizteh/fivt/students/AndrewTimokhin/FileMap/JUnit/InteractiveMode.java","position":67,"original_position":67,"commit_id":"e162d7d35082e7e855910fc561bfbfb73632b664","original_commit_id":"e162d7d35082e7e855910fc561bfbfb73632b664","user":{"login":"vpavlenko","id":1491908,"avatar_url":"https://avatars.githubusercontent.com/u/1491908?v=3","gravatar_id":"","url":"https://api.github.com/users/vpavlenko","html_url":"https://github.com/vpavlenko","followers_url":"https://api.github.com/users/vpavlenko/followers","following_url":"https://api.github.com/users/vpavlenko/following{/other_user}","gists_url":"https://api.github.com/users/vpavlenko/gists{/gist_id}","starred_url":"https://api.github.com/users/vpavlenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vpavlenko/subscriptions","organizations_url":"https://api.github.com/users/vpavlenko/orgs","repos_url":"https://api.github.com/users/vpavlenko/repos","events_url":"https://api.github.com/users/vpavlenko/events{/privacy}","received_events_url":"https://api.github.com/users/vpavlenko/received_events","type":"User","site_admin":false},"body":"Множественный повтор кода в командах. Завести базовый класс для команд, вынести повторяющийся код в него. См. решения других студентов.","created_at":"2015-02-02T06:30:18Z","updated_at":"2015-02-02T06:30:18Z","html_url":"https://github.com/dkomanov/fizteh-java-2014/pull/598#discussion_r23908729","pull_request_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/598","_links":{"self":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/comments/23908729"},"html":{"href":"https://github.com/dkomanov/fizteh-java-2014/pull/598#discussion_r23908729"},"pull_request":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/598"}}},"pull_request":{"url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/598","id":27636787,"html_url":"https://github.com/dkomanov/fizteh-java-2014/pull/598","diff_url":"https://github.com/dkomanov/fizteh-java-2014/pull/598.diff","patch_url":"https://github.com/dkomanov/fizteh-java-2014/pull/598.patch","issue_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues/598","number":598,"state":"open","locked":false,"title":"FileMap with JUnit (#Задание4)","user":{"login":"AndrewTimokhin","id":8937830,"avatar_url":"https://avatars.githubusercontent.com/u/8937830?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewTimokhin","html_url":"https://github.com/AndrewTimokhin","followers_url":"https://api.github.com/users/AndrewTimokhin/followers","following_url":"https://api.github.com/users/AndrewTimokhin/following{/other_user}","gists_url":"https://api.github.com/users/AndrewTimokhin/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewTimokhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewTimokhin/subscriptions","organizations_url":"https://api.github.com/users/AndrewTimokhin/orgs","repos_url":"https://api.github.com/users/AndrewTimokhin/repos","events_url":"https://api.github.com/users/AndrewTimokhin/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewTimokhin/received_events","type":"User","site_admin":false},"body":"В данном задании имплементированы те интерфейсы, которые запрашивались ранее. Т.е. это второй пункт решения этого задания (второй отослан ранее). Помимо методов, которые перечислены ранее, добавлен метод чтения данных с жесткого диска и также записи на жесткий диск. Тесты были написаны в среде разработки NetBeans 8.0.1. И успешно прошли. Класс JUnit служит для проверки логики работы с фабрикой, то что она производит и т.д. и т.п.  Можно скомпилировать исходные файлы в jar, тем самым собрав библиотеку и успешно ею пользоваться. Все замечания будут учтены!","created_at":"2015-01-19T21:25:18Z","updated_at":"2015-02-02T06:30:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e3067a77caee63d033506d791b46d52a4b5873f3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/598/commits","review_comments_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/598/comments","review_comment_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/comments/{number}","comments_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues/598/comments","statuses_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/statuses/e162d7d35082e7e855910fc561bfbfb73632b664","head":{"label":"AndrewTimokhin:master","ref":"master","sha":"e162d7d35082e7e855910fc561bfbfb73632b664","user":{"login":"AndrewTimokhin","id":8937830,"avatar_url":"https://avatars.githubusercontent.com/u/8937830?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewTimokhin","html_url":"https://github.com/AndrewTimokhin","followers_url":"https://api.github.com/users/AndrewTimokhin/followers","following_url":"https://api.github.com/users/AndrewTimokhin/following{/other_user}","gists_url":"https://api.github.com/users/AndrewTimokhin/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewTimokhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewTimokhin/subscriptions","organizations_url":"https://api.github.com/users/AndrewTimokhin/orgs","repos_url":"https://api.github.com/users/AndrewTimokhin/repos","events_url":"https://api.github.com/users/AndrewTimokhin/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewTimokhin/received_events","type":"User","site_admin":false},"repo":{"id":26065231,"name":"fizteh-java-2014","full_name":"AndrewTimokhin/fizteh-java-2014","owner":{"login":"AndrewTimokhin","id":8937830,"avatar_url":"https://avatars.githubusercontent.com/u/8937830?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewTimokhin","html_url":"https://github.com/AndrewTimokhin","followers_url":"https://api.github.com/users/AndrewTimokhin/followers","following_url":"https://api.github.com/users/AndrewTimokhin/following{/other_user}","gists_url":"https://api.github.com/users/AndrewTimokhin/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewTimokhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewTimokhin/subscriptions","organizations_url":"https://api.github.com/users/AndrewTimokhin/orgs","repos_url":"https://api.github.com/users/AndrewTimokhin/repos","events_url":"https://api.github.com/users/AndrewTimokhin/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewTimokhin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AndrewTimokhin/fizteh-java-2014","description":"","fork":true,"url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014","forks_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/forks","keys_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/teams","hooks_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/hooks","issue_events_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/issues/events{/number}","events_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/events","assignees_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/assignees{/user}","branches_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/branches{/branch}","tags_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/tags","blobs_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/git/refs{/sha}","trees_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/statuses/{sha}","languages_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/languages","stargazers_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/stargazers","contributors_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/contributors","subscribers_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/subscribers","subscription_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/subscription","commits_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/commits{/sha}","git_commits_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/git/commits{/sha}","comments_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/comments{/number}","issue_comment_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/issues/comments/{number}","contents_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/contents/{+path}","compare_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/merges","archive_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/downloads","issues_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/issues{/number}","pulls_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/pulls{/number}","milestones_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/milestones{/number}","notifications_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/labels{/name}","releases_url":"https://api.github.com/repos/AndrewTimokhin/fizteh-java-2014/releases{/id}","created_at":"2014-11-01T22:35:15Z","updated_at":"2015-02-01T15:11:37Z","pushed_at":"2015-02-01T15:11:35Z","git_url":"git://github.com/AndrewTimokhin/fizteh-java-2014.git","ssh_url":"git@github.com:AndrewTimokhin/fizteh-java-2014.git","clone_url":"https://github.com/AndrewTimokhin/fizteh-java-2014.git","svn_url":"https://github.com/AndrewTimokhin/fizteh-java-2014","homepage":null,"size":8080,"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":"dkomanov:master","ref":"master","sha":"da301fdee510377d59ec86f8cf5dcc9960ba3156","user":{"login":"dkomanov","id":1158662,"avatar_url":"https://avatars.githubusercontent.com/u/1158662?v=3","gravatar_id":"","url":"https://api.github.com/users/dkomanov","html_url":"https://github.com/dkomanov","followers_url":"https://api.github.com/users/dkomanov/followers","following_url":"https://api.github.com/users/dkomanov/following{/other_user}","gists_url":"https://api.github.com/users/dkomanov/gists{/gist_id}","starred_url":"https://api.github.com/users/dkomanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkomanov/subscriptions","organizations_url":"https://api.github.com/users/dkomanov/orgs","repos_url":"https://api.github.com/users/dkomanov/repos","events_url":"https://api.github.com/users/dkomanov/events{/privacy}","received_events_url":"https://api.github.com/users/dkomanov/received_events","type":"User","site_admin":false},"repo":{"id":23866876,"name":"fizteh-java-2014","full_name":"dkomanov/fizteh-java-2014","owner":{"login":"dkomanov","id":1158662,"avatar_url":"https://avatars.githubusercontent.com/u/1158662?v=3","gravatar_id":"","url":"https://api.github.com/users/dkomanov","html_url":"https://github.com/dkomanov","followers_url":"https://api.github.com/users/dkomanov/followers","following_url":"https://api.github.com/users/dkomanov/following{/other_user}","gists_url":"https://api.github.com/users/dkomanov/gists{/gist_id}","starred_url":"https://api.github.com/users/dkomanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkomanov/subscriptions","organizations_url":"https://api.github.com/users/dkomanov/orgs","repos_url":"https://api.github.com/users/dkomanov/repos","events_url":"https://api.github.com/users/dkomanov/events{/privacy}","received_events_url":"https://api.github.com/users/dkomanov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dkomanov/fizteh-java-2014","description":"","fork":false,"url":"https://api.github.com/repos/dkomanov/fizteh-java-2014","forks_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/forks","keys_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/teams","hooks_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/hooks","issue_events_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues/events{/number}","events_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/events","assignees_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/assignees{/user}","branches_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/branches{/branch}","tags_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/tags","blobs_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/git/refs{/sha}","trees_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/statuses/{sha}","languages_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/languages","stargazers_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/stargazers","contributors_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/contributors","subscribers_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/subscribers","subscription_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/subscription","commits_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/commits{/sha}","git_commits_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/git/commits{/sha}","comments_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/comments{/number}","issue_comment_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues/comments/{number}","contents_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/contents/{+path}","compare_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/merges","archive_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/downloads","issues_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues{/number}","pulls_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls{/number}","milestones_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/milestones{/number}","notifications_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/labels{/name}","releases_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/releases{/id}","created_at":"2014-09-10T08:32:49Z","updated_at":"2014-12-27T19:21:06Z","pushed_at":"2014-12-27T15:00:31Z","git_url":"git://github.com/dkomanov/fizteh-java-2014.git","ssh_url":"git@github.com:dkomanov/fizteh-java-2014.git","clone_url":"https://github.com/dkomanov/fizteh-java-2014.git","svn_url":"https://github.com/dkomanov/fizteh-java-2014","homepage":null,"size":35831,"stargazers_count":8,"watchers_count":8,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":84,"mirror_url":null,"open_issues_count":52,"forks":84,"open_issues":52,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/598"},"html":{"href":"https://github.com/dkomanov/fizteh-java-2014/pull/598"},"issue":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues/598"},"comments":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues/598/comments"},"review_comments":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/598/comments"},"review_comment":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/598/commits"},"statuses":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/statuses/e162d7d35082e7e855910fc561bfbfb73632b664"}}}}