GitHub PullRequestReviewCommentEvent at 2014-11-01 11:39:18
Repository: fizteh-java-2014
Actor: volodden
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/comments/19703777","id":19703777,"diff_hunk":"@@ -0,0 +1,141 @@\n+package ru.fizteh.fivt.students.ekaterina_pogodina.multiFileMap;\n+\n+import ru.fizteh.fivt.students.ekaterina_pogodina.shell.Rm;\n+\n+import java.util.HashMap;\n+import java.util.Map;\n+import java.nio.file.Path;\n+import java.nio.file.Paths;\n+\n+public class TableManager {\n+    public String currentTable;\n+    public Path path;\n+    public Table usingTable;\n+    public Map<String, Table> tables;\n+\n+    public TableManager(String dir) throws Exception {\n+        currentTable = null;\n+        try {\n+            path = Paths.get(dir);\n+            if (!path.toFile().exists()) {\n+                path.toFile().mkdir();\n+            }\n+            if (!path.toFile().isDirectory()) {\n+                throw new Exception(\"path is incorrect\");\n+            }\n+        } catch (Exception e) {\n+\n+            throw new Exception(\"path is incorrect\", e);\n+        }\n+        tables = new HashMap<>();\n+        String[] tablesList = path.toFile().list();\n+        for (String curDir : tablesList) {\n+            Path curTableDirPath = path.resolve(curDir);\n+            if (curTableDirPath.toFile().isDirectory()) {\n+                tables.put(curDir, new Table(curDir));\n+            } else {\n+                throw new Exception(\"root directory contains non-directory files\");\n+            }\n+        }\n+    }\n+\n+    public boolean drop(String name) throws Exception {\n+        if (name == null) {\n+            throw new Exception(\"Table name is null\");\n+        }\n+        boolean flag = tables.containsKey(name);\n+        if (!flag) {\n+            System.out.println(name + \" not exists\");\n+        } else {\n+            Path newPath = path.resolve(name);\n+            String[] args = new String[3];\n+            args[0] = \"rm\";\n+            args[1] = \"-r\";\n+            args[2] = newPath.toString();\n+            Rm.run(args, true, 2);\n+            tables.remove(name);\n+        }\n+        return flag;\n+    }\n+\n+    public void create(String name) throws Exception {\n+        if (name == null) {\n+            throw new Exception(\"Table name is null\");\n+        }\n+        try {\n+            boolean flag = tables.containsKey(name);\n+            if (!flag) {\n+                System.out.println(\"created\");\n+                tables.put(name, new Table(name));\n+                try {\n+                    tables.put(name, new Table(name));\n+                    Path newPath = path.resolve(name);\n+                    newPath.toFile().mkdir();\n+                } catch (Exception e) {\n+                    throw new Exception(\"incorrect name\", e);\n+                }\n+            } else {\n+                System.out.println(name + \" already exists\");\n+            }\n+        } catch (Exception e) {\n+            throw new Exception(\"Illegal table name\", e);\n+        }\n+    }\n+\n+    public void use(String name) throws Exception {\n+        if (name == null) {\n+            throw new Exception(\"Table name is null\");\n+        }\n+        if (currentTable != null) {\n+            Table curTable = tables.get(currentTable);\n+            for (int i = 0; i < 16; i++) {\n+                for (int j = 0; j < 16; j++) {\n+                    if (curTable.tableDateBase[i][j] != null) {\n+                        curTable.tableDateBase[i][j].close();\n+                    }\n+                }\n+            }\n+            if (currentTable.equals(name)) {\n+                throw new Exception(name + \" exists\");\n+            }\n+        }\n+        try {\n+            boolean flag = tables.containsKey(name);\n+            if (flag) {","path":"src/ru/fizteh/fivt/students/ekaterina_pogodina/multiFileMap/TableManager.java","position":104,"original_position":104,"commit_id":"83354d993bae88a9f6fcb8ccd7b3b72ec5ef5489","original_commit_id":"83354d993bae88a9f6fcb8ccd7b3b72ec5ef5489","user":{"login":"volodden","id":8759062,"avatar_url":"https://avatars.githubusercontent.com/u/8759062?v=2","gravatar_id":"","url":"https://api.github.com/users/volodden","html_url":"https://github.com/volodden","followers_url":"https://api.github.com/users/volodden/followers","following_url":"https://api.github.com/users/volodden/following{/other_user}","gists_url":"https://api.github.com/users/volodden/gists{/gist_id}","starred_url":"https://api.github.com/users/volodden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/volodden/subscriptions","organizations_url":"https://api.github.com/users/volodden/orgs","repos_url":"https://api.github.com/users/volodden/repos","events_url":"https://api.github.com/users/volodden/events{/privacy}","received_events_url":"https://api.github.com/users/volodden/received_events","type":"User","site_admin":false},"body":"if (tables.containsKey(name))","created_at":"2014-11-01T11:39:18Z","updated_at":"2014-11-01T11:39:18Z","html_url":"https://github.com/dkomanov/fizteh-java-2014/pull/273#discussion_r19703777","pull_request_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/273","_links":{"self":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/comments/19703777"},"html":{"href":"https://github.com/dkomanov/fizteh-java-2014/pull/273#discussion_r19703777"},"pull_request":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/273"}}},"pull_request":{"url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/273","id":23267711,"html_url":"https://github.com/dkomanov/fizteh-java-2014/pull/273","diff_url":"https://github.com/dkomanov/fizteh-java-2014/pull/273.diff","patch_url":"https://github.com/dkomanov/fizteh-java-2014/pull/273.patch","issue_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues/273","number":273,"state":"open","locked":false,"title":"Погодина Екатерина, 397, multifile","user":{"login":"EkaterinaPogodina","id":8936131,"avatar_url":"https://avatars.githubusercontent.com/u/8936131?v=2","gravatar_id":"","url":"https://api.github.com/users/EkaterinaPogodina","html_url":"https://github.com/EkaterinaPogodina","followers_url":"https://api.github.com/users/EkaterinaPogodina/followers","following_url":"https://api.github.com/users/EkaterinaPogodina/following{/other_user}","gists_url":"https://api.github.com/users/EkaterinaPogodina/gists{/gist_id}","starred_url":"https://api.github.com/users/EkaterinaPogodina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EkaterinaPogodina/subscriptions","organizations_url":"https://api.github.com/users/EkaterinaPogodina/orgs","repos_url":"https://api.github.com/users/EkaterinaPogodina/repos","events_url":"https://api.github.com/users/EkaterinaPogodina/events{/privacy}","received_events_url":"https://api.github.com/users/EkaterinaPogodina/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-10-23T23:34:56Z","updated_at":"2014-11-01T11:39:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c4242958ed030a79f82e3d5edbadb17c571d604c","assignee":{"login":"vpavlenko","id":1491908,"avatar_url":"https://avatars.githubusercontent.com/u/1491908?v=2","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},"milestone":null,"commits_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/273/commits","review_comments_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/273/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/273/comments","statuses_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/statuses/83354d993bae88a9f6fcb8ccd7b3b72ec5ef5489","head":{"label":"EkaterinaPogodina:master","ref":"master","sha":"83354d993bae88a9f6fcb8ccd7b3b72ec5ef5489","user":{"login":"EkaterinaPogodina","id":8936131,"avatar_url":"https://avatars.githubusercontent.com/u/8936131?v=2","gravatar_id":"","url":"https://api.github.com/users/EkaterinaPogodina","html_url":"https://github.com/EkaterinaPogodina","followers_url":"https://api.github.com/users/EkaterinaPogodina/followers","following_url":"https://api.github.com/users/EkaterinaPogodina/following{/other_user}","gists_url":"https://api.github.com/users/EkaterinaPogodina/gists{/gist_id}","starred_url":"https://api.github.com/users/EkaterinaPogodina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EkaterinaPogodina/subscriptions","organizations_url":"https://api.github.com/users/EkaterinaPogodina/orgs","repos_url":"https://api.github.com/users/EkaterinaPogodina/repos","events_url":"https://api.github.com/users/EkaterinaPogodina/events{/privacy}","received_events_url":"https://api.github.com/users/EkaterinaPogodina/received_events","type":"User","site_admin":false},"repo":{"id":24531500,"name":"fizteh-java-2014","full_name":"EkaterinaPogodina/fizteh-java-2014","owner":{"login":"EkaterinaPogodina","id":8936131,"avatar_url":"https://avatars.githubusercontent.com/u/8936131?v=2","gravatar_id":"","url":"https://api.github.com/users/EkaterinaPogodina","html_url":"https://github.com/EkaterinaPogodina","followers_url":"https://api.github.com/users/EkaterinaPogodina/followers","following_url":"https://api.github.com/users/EkaterinaPogodina/following{/other_user}","gists_url":"https://api.github.com/users/EkaterinaPogodina/gists{/gist_id}","starred_url":"https://api.github.com/users/EkaterinaPogodina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EkaterinaPogodina/subscriptions","organizations_url":"https://api.github.com/users/EkaterinaPogodina/orgs","repos_url":"https://api.github.com/users/EkaterinaPogodina/repos","events_url":"https://api.github.com/users/EkaterinaPogodina/events{/privacy}","received_events_url":"https://api.github.com/users/EkaterinaPogodina/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/EkaterinaPogodina/fizteh-java-2014","description":"Екатерина Погодина, 397, FileMap","fork":true,"url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014","forks_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/forks","keys_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/teams","hooks_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/hooks","issue_events_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/issues/events{/number}","events_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/events","assignees_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/assignees{/user}","branches_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/branches{/branch}","tags_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/tags","blobs_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/git/refs{/sha}","trees_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/statuses/{sha}","languages_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/languages","stargazers_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/stargazers","contributors_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/contributors","subscribers_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/subscribers","subscription_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/subscription","commits_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/commits{/sha}","git_commits_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/git/commits{/sha}","comments_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/comments{/number}","issue_comment_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/issues/comments/{number}","contents_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/contents/{+path}","compare_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/merges","archive_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/downloads","issues_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/issues{/number}","pulls_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/pulls{/number}","milestones_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/milestones{/number}","notifications_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/labels{/name}","releases_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/releases{/id}","created_at":"2014-09-27T12:40:16Z","updated_at":"2014-10-10T17:57:27Z","pushed_at":"2014-10-27T08:57:04Z","git_url":"git://github.com/EkaterinaPogodina/fizteh-java-2014.git","ssh_url":"git@github.com:EkaterinaPogodina/fizteh-java-2014.git","clone_url":"https://github.com/EkaterinaPogodina/fizteh-java-2014.git","svn_url":"https://github.com/EkaterinaPogodina/fizteh-java-2014","homepage":"","size":3001,"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":"8090ce0a1f8720575c93a4792f5d8baa9c4d3dd0","user":{"login":"dkomanov","id":1158662,"avatar_url":"https://avatars.githubusercontent.com/u/1158662?v=2","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=2","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-10-23T21:36:51Z","pushed_at":"2014-10-27T21:01:47Z","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":16233,"stargazers_count":5,"watchers_count":5,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":85,"mirror_url":null,"open_issues_count":87,"forks":85,"open_issues":87,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/273"},"html":{"href":"https://github.com/dkomanov/fizteh-java-2014/pull/273"},"issue":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues/273"},"comments":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues/273/comments"},"review_comments":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/273/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/273/commits"},"statuses":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/statuses/83354d993bae88a9f6fcb8ccd7b3b72ec5ef5489"}}}}