{"action":"created","comment":{"url":"https://api.github.com/repos/VovkGeorgy/FileSorter/pulls/comments/242047475","pull_request_review_id":185466013,"id":242047475,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MjA0NzQ3NQ==","diff_hunk":"@@ -0,0 +1,83 @@\n+package by.home.fileSorter;\n+\n+import by.home.fileSorter.service.IFIleValidator;\n+import by.home.fileSorter.service.IFileMover;\n+import by.home.fileSorter.service.IFileParser;\n+import by.home.fileSorter.service.IMessageBuilder;\n+import by.home.fileSorter.service.factory.FileMoverFactory;\n+import by.home.fileSorter.service.factory.FileParserFactory;\n+import by.home.fileSorter.service.factory.FileValidatorFactory;\n+import by.home.fileSorter.service.factory.MessageBuilderFactory;\n+import by.home.fileSorter.service.file.FileReader;\n+import by.home.fileSorter.service.file.FileSeparator;\n+import by.home.fileSorter.service.file.FilesFolderScanner;\n+import by.home.fileSorter.service.impl.txt.TxtFileParser;\n+import by.home.fileSorter.utils.PropertiesUtils;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+import org.springframework.beans.factory.annotation.Autowired;\n+\n+import java.io.File;\n+import java.util.List;\n+\n+/**\n+ * Class control program running\n+ */\n+public class SorterRunner {\n+\n+    @Autowired\n+    private FilesFolderScanner filesFolderScanner;\n+    @Autowired\n+    private PropertiesUtils propertiesUtils;\n+    @Autowired\n+    private FileSeparator fileSeparator;\n+    @Autowired\n+    private FileMoverFactory fileMoverFactory;\n+    @Autowired\n+    private FileParserFactory fileParserFactory;\n+    @Autowired\n+    private FileReader fileReader;\n+    @Autowired\n+    private FileValidatorFactory fileValidatorFactory;\n+    @Autowired\n+    private MessageBuilderFactory messageBuilderFactory;\n+\n+    private static final Logger LOGGER = LoggerFactory.getLogger(SorterRunner.class);\n+\n+    /**\n+     * Method exist all program functions, to step by step working\n+     */\n+    void runSorter() {\n+        LOGGER.info(\"Program started\");\n+        List<String> fileTemplates = propertiesUtils.getTemplates();\n+        for (String template : fileTemplates) {\n+            List<File> notSortedFiles = filesFolderScanner.scan();\n+            LOGGER.debug(\"Get not sorted {} files {}\", template, notSortedFiles);\n+            if (notSortedFiles == null) continue;\n+            List<File> sortedFiles = fileSeparator.separate(notSortedFiles, template);\n+            LOGGER.debug(\"Get sorted {} files {}\", template, sortedFiles);\n+            if (sortedFiles == null) continue;\n+            IFileParser fileParser = fileParserFactory.getFileParser(sortedFiles);\n+            LOGGER.debug(\"Get file parser {}\", fileParser);\n+            IFIleValidator fileValidator = fileValidatorFactory.getFileValidator(fileParser);\n+            LOGGER.debug(\"Get file validator {}\", fileValidator);\n+            sortedFiles.forEach(file -> fileValidator.valid(fileParser.getMessages(fileReader.readFile(file.getPath())), file));\n+            IMessageBuilder messageBuilder = messageBuilderFactory.getFileBuilder(fileParser);\n+            LOGGER.debug(\"Get message builder {}\", messageBuilder);\n+            messageBuilder.build();\n+            IFileMover fileMover = fileMoverFactory.getFileMover(fileParser);\n+            LOGGER.debug(\"Get file mover {}\", fileMover);\n+            List<File> validFileList = fileValidator.getValidMessageFileList();\n+            List<File> notValidFileList = fileValidator.getNotValidMessageFileList();\n+            fileMover.moveFiles(validFileList, notValidFileList);\n+            LOGGER.info(\"End cycle of program\");\n+        }\n+        try {\n+            LOGGER.debug(\"Wait {} mseconds\", propertiesUtils.getScanDelay());\n+            Thread.sleep(propertiesUtils.getScanDelay());\n+            runSorter();","path":"src/main/java/by/home/fileSorter/SorterRunner.java","position":78,"original_position":78,"commit_id":"71ef91512f853673fc1a89da2fda039501e17356","original_commit_id":"71ef91512f853673fc1a89da2fda039501e17356","user":{"login":"VovkGeorgy","id":30996856,"node_id":"MDQ6VXNlcjMwOTk2ODU2","avatar_url":"https://avatars2.githubusercontent.com/u/30996856?v=4","gravatar_id":"","url":"https://api.github.com/users/VovkGeorgy","html_url":"https://github.com/VovkGeorgy","followers_url":"https://api.github.com/users/VovkGeorgy/followers","following_url":"https://api.github.com/users/VovkGeorgy/following{/other_user}","gists_url":"https://api.github.com/users/VovkGeorgy/gists{/gist_id}","starred_url":"https://api.github.com/users/VovkGeorgy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VovkGeorgy/subscriptions","organizations_url":"https://api.github.com/users/VovkGeorgy/orgs","repos_url":"https://api.github.com/users/VovkGeorgy/repos","events_url":"https://api.github.com/users/VovkGeorgy/events{/privacy}","received_events_url":"https://api.github.com/users/VovkGeorgy/received_events","type":"User","site_admin":false},"body":"check","created_at":"2018-12-17T07:42:25Z","updated_at":"2018-12-17T07:42:25Z","html_url":"https://github.com/VovkGeorgy/FileSorter/pull/1#discussion_r242047475","pull_request_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/pulls/1","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/VovkGeorgy/FileSorter/pulls/comments/242047475"},"html":{"href":"https://github.com/VovkGeorgy/FileSorter/pull/1#discussion_r242047475"},"pull_request":{"href":"https://api.github.com/repos/VovkGeorgy/FileSorter/pulls/1"}},"in_reply_to_id":241958432},"pull_request":{"url":"https://api.github.com/repos/VovkGeorgy/FileSorter/pulls/1","id":238917540,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM4OTE3NTQw","html_url":"https://github.com/VovkGeorgy/FileSorter/pull/1","diff_url":"https://github.com/VovkGeorgy/FileSorter/pull/1.diff","patch_url":"https://github.com/VovkGeorgy/FileSorter/pull/1.patch","issue_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/issues/1","number":1,"state":"open","locked":false,"title":"JSON & TXT file sorter, with sftp","user":{"login":"VovkGeorgy","id":30996856,"node_id":"MDQ6VXNlcjMwOTk2ODU2","avatar_url":"https://avatars2.githubusercontent.com/u/30996856?v=4","gravatar_id":"","url":"https://api.github.com/users/VovkGeorgy","html_url":"https://github.com/VovkGeorgy","followers_url":"https://api.github.com/users/VovkGeorgy/followers","following_url":"https://api.github.com/users/VovkGeorgy/following{/other_user}","gists_url":"https://api.github.com/users/VovkGeorgy/gists{/gist_id}","starred_url":"https://api.github.com/users/VovkGeorgy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VovkGeorgy/subscriptions","organizations_url":"https://api.github.com/users/VovkGeorgy/orgs","repos_url":"https://api.github.com/users/VovkGeorgy/repos","events_url":"https://api.github.com/users/VovkGeorgy/events{/privacy}","received_events_url":"https://api.github.com/users/VovkGeorgy/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-12-15T15:40:09Z","updated_at":"2018-12-17T07:42:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7983186cc9f2849b5805cd7a79f9ba41b09677a5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/pulls/1/commits","review_comments_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/pulls/1/comments","review_comment_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/issues/1/comments","statuses_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/statuses/71ef91512f853673fc1a89da2fda039501e17356","head":{"label":"VovkGeorgy:sorter-feature","ref":"sorter-feature","sha":"71ef91512f853673fc1a89da2fda039501e17356","user":{"login":"VovkGeorgy","id":30996856,"node_id":"MDQ6VXNlcjMwOTk2ODU2","avatar_url":"https://avatars2.githubusercontent.com/u/30996856?v=4","gravatar_id":"","url":"https://api.github.com/users/VovkGeorgy","html_url":"https://github.com/VovkGeorgy","followers_url":"https://api.github.com/users/VovkGeorgy/followers","following_url":"https://api.github.com/users/VovkGeorgy/following{/other_user}","gists_url":"https://api.github.com/users/VovkGeorgy/gists{/gist_id}","starred_url":"https://api.github.com/users/VovkGeorgy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VovkGeorgy/subscriptions","organizations_url":"https://api.github.com/users/VovkGeorgy/orgs","repos_url":"https://api.github.com/users/VovkGeorgy/repos","events_url":"https://api.github.com/users/VovkGeorgy/events{/privacy}","received_events_url":"https://api.github.com/users/VovkGeorgy/received_events","type":"User","site_admin":false},"repo":{"id":161903616,"node_id":"MDEwOlJlcG9zaXRvcnkxNjE5MDM2MTY=","name":"FileSorter","full_name":"VovkGeorgy/FileSorter","private":false,"owner":{"login":"VovkGeorgy","id":30996856,"node_id":"MDQ6VXNlcjMwOTk2ODU2","avatar_url":"https://avatars2.githubusercontent.com/u/30996856?v=4","gravatar_id":"","url":"https://api.github.com/users/VovkGeorgy","html_url":"https://github.com/VovkGeorgy","followers_url":"https://api.github.com/users/VovkGeorgy/followers","following_url":"https://api.github.com/users/VovkGeorgy/following{/other_user}","gists_url":"https://api.github.com/users/VovkGeorgy/gists{/gist_id}","starred_url":"https://api.github.com/users/VovkGeorgy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VovkGeorgy/subscriptions","organizations_url":"https://api.github.com/users/VovkGeorgy/orgs","repos_url":"https://api.github.com/users/VovkGeorgy/repos","events_url":"https://api.github.com/users/VovkGeorgy/events{/privacy}","received_events_url":"https://api.github.com/users/VovkGeorgy/received_events","type":"User","site_admin":false},"html_url":"https://github.com/VovkGeorgy/FileSorter","description":null,"fork":false,"url":"https://api.github.com/repos/VovkGeorgy/FileSorter","forks_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/forks","keys_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/teams","hooks_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/hooks","issue_events_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/issues/events{/number}","events_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/events","assignees_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/assignees{/user}","branches_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/branches{/branch}","tags_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/tags","blobs_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/git/refs{/sha}","trees_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/statuses/{sha}","languages_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/languages","stargazers_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/stargazers","contributors_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/contributors","subscribers_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/subscribers","subscription_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/subscription","commits_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/commits{/sha}","git_commits_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/git/commits{/sha}","comments_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/comments{/number}","issue_comment_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/issues/comments{/number}","contents_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/contents/{+path}","compare_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/merges","archive_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/downloads","issues_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/issues{/number}","pulls_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/pulls{/number}","milestones_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/milestones{/number}","notifications_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/labels{/name}","releases_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/releases{/id}","deployments_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/deployments","created_at":"2018-12-15T12:37:49Z","updated_at":"2018-12-15T12:44:26Z","pushed_at":"2018-12-15T15:40:09Z","git_url":"git://github.com/VovkGeorgy/FileSorter.git","ssh_url":"git@github.com:VovkGeorgy/FileSorter.git","clone_url":"https://github.com/VovkGeorgy/FileSorter.git","svn_url":"https://github.com/VovkGeorgy/FileSorter","homepage":null,"size":18,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"VovkGeorgy:develop","ref":"develop","sha":"939843047c685381287bfedd80a7a2d30e46aaab","user":{"login":"VovkGeorgy","id":30996856,"node_id":"MDQ6VXNlcjMwOTk2ODU2","avatar_url":"https://avatars2.githubusercontent.com/u/30996856?v=4","gravatar_id":"","url":"https://api.github.com/users/VovkGeorgy","html_url":"https://github.com/VovkGeorgy","followers_url":"https://api.github.com/users/VovkGeorgy/followers","following_url":"https://api.github.com/users/VovkGeorgy/following{/other_user}","gists_url":"https://api.github.com/users/VovkGeorgy/gists{/gist_id}","starred_url":"https://api.github.com/users/VovkGeorgy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VovkGeorgy/subscriptions","organizations_url":"https://api.github.com/users/VovkGeorgy/orgs","repos_url":"https://api.github.com/users/VovkGeorgy/repos","events_url":"https://api.github.com/users/VovkGeorgy/events{/privacy}","received_events_url":"https://api.github.com/users/VovkGeorgy/received_events","type":"User","site_admin":false},"repo":{"id":161903616,"node_id":"MDEwOlJlcG9zaXRvcnkxNjE5MDM2MTY=","name":"FileSorter","full_name":"VovkGeorgy/FileSorter","private":false,"owner":{"login":"VovkGeorgy","id":30996856,"node_id":"MDQ6VXNlcjMwOTk2ODU2","avatar_url":"https://avatars2.githubusercontent.com/u/30996856?v=4","gravatar_id":"","url":"https://api.github.com/users/VovkGeorgy","html_url":"https://github.com/VovkGeorgy","followers_url":"https://api.github.com/users/VovkGeorgy/followers","following_url":"https://api.github.com/users/VovkGeorgy/following{/other_user}","gists_url":"https://api.github.com/users/VovkGeorgy/gists{/gist_id}","starred_url":"https://api.github.com/users/VovkGeorgy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VovkGeorgy/subscriptions","organizations_url":"https://api.github.com/users/VovkGeorgy/orgs","repos_url":"https://api.github.com/users/VovkGeorgy/repos","events_url":"https://api.github.com/users/VovkGeorgy/events{/privacy}","received_events_url":"https://api.github.com/users/VovkGeorgy/received_events","type":"User","site_admin":false},"html_url":"https://github.com/VovkGeorgy/FileSorter","description":null,"fork":false,"url":"https://api.github.com/repos/VovkGeorgy/FileSorter","forks_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/forks","keys_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/teams","hooks_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/hooks","issue_events_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/issues/events{/number}","events_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/events","assignees_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/assignees{/user}","branches_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/branches{/branch}","tags_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/tags","blobs_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/git/refs{/sha}","trees_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/statuses/{sha}","languages_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/languages","stargazers_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/stargazers","contributors_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/contributors","subscribers_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/subscribers","subscription_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/subscription","commits_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/commits{/sha}","git_commits_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/git/commits{/sha}","comments_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/comments{/number}","issue_comment_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/issues/comments{/number}","contents_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/contents/{+path}","compare_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/merges","archive_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/downloads","issues_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/issues{/number}","pulls_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/pulls{/number}","milestones_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/milestones{/number}","notifications_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/labels{/name}","releases_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/releases{/id}","deployments_url":"https://api.github.com/repos/VovkGeorgy/FileSorter/deployments","created_at":"2018-12-15T12:37:49Z","updated_at":"2018-12-15T12:44:26Z","pushed_at":"2018-12-15T15:40:09Z","git_url":"git://github.com/VovkGeorgy/FileSorter.git","ssh_url":"git@github.com:VovkGeorgy/FileSorter.git","clone_url":"https://github.com/VovkGeorgy/FileSorter.git","svn_url":"https://github.com/VovkGeorgy/FileSorter","homepage":null,"size":18,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/VovkGeorgy/FileSorter/pulls/1"},"html":{"href":"https://github.com/VovkGeorgy/FileSorter/pull/1"},"issue":{"href":"https://api.github.com/repos/VovkGeorgy/FileSorter/issues/1"},"comments":{"href":"https://api.github.com/repos/VovkGeorgy/FileSorter/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/VovkGeorgy/FileSorter/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/VovkGeorgy/FileSorter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/VovkGeorgy/FileSorter/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/VovkGeorgy/FileSorter/statuses/71ef91512f853673fc1a89da2fda039501e17356"}},"author_association":"OWNER"}}
{"actor":{"display_login":"VovkGeorgy"}}