{"action":"created","comment":{"url":"https://api.github.com/repos/CloudSlang/score-actions/pulls/comments/70151980","id":70151980,"diff_hunk":"@@ -166,40 +166,41 @@ private ActionsEnum getAction(String action) {\n      * @throws Exception for invalid inputs\n      */\n     private void validateInputs(String xml, String filePath, String action, String xpath1, String xpath2, String type, String name, String features) throws Exception {\n-        if ((filePath == null || StringUtils.isEmpty(filePath)) && (xml == null || StringUtils.isEmpty(xml))) {\n-            throw new Exception(\"Supplied parameters: either file path or xml is missing when one is required\");\n-        }\n-        if ((!StringUtils.isEmpty(filePath)) && (!StringUtils.isEmpty(xml))) {\n-            throw new Exception(\"Supplied parameters: file path and xml when only one is required\");\n-        }\n-        if (action == null || StringUtils.isEmpty(action)) {\n-            throw new Exception(\"ACTION input is required.\");\n-        }\n-        if (xpath1 == null || StringUtils.isEmpty(xpath1)) {\n-            throw new Exception(\"XPATH1 input is required.\");\n-        }\n-        if (MOVE_ACTION.equals(action)) {\n-            if (xpath2 == null || StringUtils.isEmpty(xpath2)) {\n-                throw new Exception(\"XPATH2 input is required for action 'move' \");\n-            }\n+        validateXmlAndFilePathInputs(xml, filePath);\n+        validateIsNotEmpty(action, \"ACTION input is required.\");\n+        validateIsNotEmpty(xpath1, \"XPATH1 input is required.\");\n+\n+        if (Constants.Inputs.MOVE_ACTION.equals(action)) {\n+            validateIsNotEmpty(xpath2, \"XPATH2 input is required for action 'move' \");\n         }\n-        if (!SUBNODE_ACTION.equals(action) && !MOVE_ACTION.equals(action)) {\n-            if (type == null || StringUtils.isEmpty(type)) {\n-                throw new Exception(\"TYPE input is required for action '\" + action + \"'\");\n+        if (!Constants.Inputs.SUBNODE_ACTION.equals(action) && !Constants.Inputs.MOVE_ACTION.equals(action)) {\n+            validateIsNotEmpty(type, \"TYPE input is required for action '\" + action + \"'\");\n+            if (!Constants.Inputs.TYPE_ELEM.equals(type) && !Constants.Inputs.TYPE_ATTR.equals(type) && !Constants.Inputs.TYPE_TEXT.equals(type)) {\n+                throw new Exception(\"Invalid type. Only supported : \" + Constants.Inputs.TYPE_ELEM + \", \" + Constants.Inputs.TYPE_ATTR + \", \" + Constants.Inputs.TYPE_TEXT);\n             }\n-            if (!TYPE_ELEM.equals(type) && !TYPE_ATTR.equals(type) && !TYPE_TEXT.equals(type)) {\n-                throw new Exception(\"Invalid type. Only supported : \" + TYPE_ELEM + \", \" + TYPE_ATTR + \", \" + TYPE_TEXT);\n-            }\n-            if (TYPE_ATTR.equals(type)) {\n-                if (name == null || StringUtils.isEmpty(name)) {\n-                    throw new Exception(\"NAME input is required for type 'attr' \");\n-                }\n+            if (Constants.Inputs.TYPE_ATTR.equals(type)) {\n+                validateIsNotEmpty(name, \"NAME input is required for type 'attr' \");\n             }\n         }\n \n         setFeatures(features);\n     }\n \n+    private void validateIsNotEmpty(String action, String message) throws Exception {\n+        if (action == null || StringUtils.isEmpty(action)) {","path":"score-xml/src/main/java/io/cloudslang/content/xml/actions/EditXml.java","position":null,"original_position":226,"commit_id":"34b1cdf8d868f7f5551110c81dac3d78e4baaef5","original_commit_id":"b4db51f350732d97860732ccbf0cdd77aeabb473","user":{"login":"tethryus","id":796864,"avatar_url":"https://avatars.githubusercontent.com/u/796864?v=3","gravatar_id":"","url":"https://api.github.com/users/tethryus","html_url":"https://github.com/tethryus","followers_url":"https://api.github.com/users/tethryus/followers","following_url":"https://api.github.com/users/tethryus/following{/other_user}","gists_url":"https://api.github.com/users/tethryus/gists{/gist_id}","starred_url":"https://api.github.com/users/tethryus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tethryus/subscriptions","organizations_url":"https://api.github.com/users/tethryus/orgs","repos_url":"https://api.github.com/users/tethryus/repos","events_url":"https://api.github.com/users/tethryus/events{/privacy}","received_events_url":"https://api.github.com/users/tethryus/received_events","type":"User","site_admin":false},"body":"changed","created_at":"2016-07-08T22:49:31Z","updated_at":"2016-07-08T22:49:31Z","html_url":"https://github.com/CloudSlang/score-actions/pull/134#discussion_r70151980","pull_request_url":"https://api.github.com/repos/CloudSlang/score-actions/pulls/134","_links":{"self":{"href":"https://api.github.com/repos/CloudSlang/score-actions/pulls/comments/70151980"},"html":{"href":"https://github.com/CloudSlang/score-actions/pull/134#discussion_r70151980"},"pull_request":{"href":"https://api.github.com/repos/CloudSlang/score-actions/pulls/134"}}},"pull_request":{"url":"https://api.github.com/repos/CloudSlang/score-actions/pulls/134","id":74980306,"html_url":"https://github.com/CloudSlang/score-actions/pull/134","diff_url":"https://github.com/CloudSlang/score-actions/pull/134.diff","patch_url":"https://github.com/CloudSlang/score-actions/pull/134.patch","issue_url":"https://api.github.com/repos/CloudSlang/score-actions/issues/134","number":134,"state":"open","locked":false,"title":"XML Operations","user":{"login":"tethryus","id":796864,"avatar_url":"https://avatars.githubusercontent.com/u/796864?v=3","gravatar_id":"","url":"https://api.github.com/users/tethryus","html_url":"https://github.com/tethryus","followers_url":"https://api.github.com/users/tethryus/followers","following_url":"https://api.github.com/users/tethryus/following{/other_user}","gists_url":"https://api.github.com/users/tethryus/gists{/gist_id}","starred_url":"https://api.github.com/users/tethryus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tethryus/subscriptions","organizations_url":"https://api.github.com/users/tethryus/orgs","repos_url":"https://api.github.com/users/tethryus/repos","events_url":"https://api.github.com/users/tethryus/events{/privacy}","received_events_url":"https://api.github.com/users/tethryus/received_events","type":"User","site_admin":false},"body":"Added read from file for all operations\r\nAdded read from URL for the validate operation\r\nIncluded tests\r\n\r\nSigned-off-by: Sorin Moldovan sorin.moldovan@hpe.com","created_at":"2016-06-23T15:54:42Z","updated_at":"2016-07-08T22:49:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ce2734c9590990dc42f95e41c832f3f33144747","assignee":{"login":"george-giloan","id":9443835,"avatar_url":"https://avatars.githubusercontent.com/u/9443835?v=3","gravatar_id":"","url":"https://api.github.com/users/george-giloan","html_url":"https://github.com/george-giloan","followers_url":"https://api.github.com/users/george-giloan/followers","following_url":"https://api.github.com/users/george-giloan/following{/other_user}","gists_url":"https://api.github.com/users/george-giloan/gists{/gist_id}","starred_url":"https://api.github.com/users/george-giloan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/george-giloan/subscriptions","organizations_url":"https://api.github.com/users/george-giloan/orgs","repos_url":"https://api.github.com/users/george-giloan/repos","events_url":"https://api.github.com/users/george-giloan/events{/privacy}","received_events_url":"https://api.github.com/users/george-giloan/received_events","type":"User","site_admin":false},"assignees":[{"login":"george-giloan","id":9443835,"avatar_url":"https://avatars.githubusercontent.com/u/9443835?v=3","gravatar_id":"","url":"https://api.github.com/users/george-giloan","html_url":"https://github.com/george-giloan","followers_url":"https://api.github.com/users/george-giloan/followers","following_url":"https://api.github.com/users/george-giloan/following{/other_user}","gists_url":"https://api.github.com/users/george-giloan/gists{/gist_id}","starred_url":"https://api.github.com/users/george-giloan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/george-giloan/subscriptions","organizations_url":"https://api.github.com/users/george-giloan/orgs","repos_url":"https://api.github.com/users/george-giloan/repos","events_url":"https://api.github.com/users/george-giloan/events{/privacy}","received_events_url":"https://api.github.com/users/george-giloan/received_events","type":"User","site_admin":false},{"login":"gituser173","id":12094982,"avatar_url":"https://avatars.githubusercontent.com/u/12094982?v=3","gravatar_id":"","url":"https://api.github.com/users/gituser173","html_url":"https://github.com/gituser173","followers_url":"https://api.github.com/users/gituser173/followers","following_url":"https://api.github.com/users/gituser173/following{/other_user}","gists_url":"https://api.github.com/users/gituser173/gists{/gist_id}","starred_url":"https://api.github.com/users/gituser173/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gituser173/subscriptions","organizations_url":"https://api.github.com/users/gituser173/orgs","repos_url":"https://api.github.com/users/gituser173/repos","events_url":"https://api.github.com/users/gituser173/events{/privacy}","received_events_url":"https://api.github.com/users/gituser173/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/CloudSlang/score-actions/milestones/24","html_url":"https://github.com/CloudSlang/score-actions/milestones/1.0%20-%20sprint%201%20","labels_url":"https://api.github.com/repos/CloudSlang/score-actions/milestones/24/labels","id":1863120,"number":24,"title":"1.0 - sprint 1 ","description":"","creator":{"login":"meshipeer","id":6988387,"avatar_url":"https://avatars.githubusercontent.com/u/6988387?v=3","gravatar_id":"","url":"https://api.github.com/users/meshipeer","html_url":"https://github.com/meshipeer","followers_url":"https://api.github.com/users/meshipeer/followers","following_url":"https://api.github.com/users/meshipeer/following{/other_user}","gists_url":"https://api.github.com/users/meshipeer/gists{/gist_id}","starred_url":"https://api.github.com/users/meshipeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meshipeer/subscriptions","organizations_url":"https://api.github.com/users/meshipeer/orgs","repos_url":"https://api.github.com/users/meshipeer/repos","events_url":"https://api.github.com/users/meshipeer/events{/privacy}","received_events_url":"https://api.github.com/users/meshipeer/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2016-07-04T12:01:48Z","updated_at":"2016-07-07T06:53:39Z","due_on":"2016-07-16T21:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/CloudSlang/score-actions/pulls/134/commits","review_comments_url":"https://api.github.com/repos/CloudSlang/score-actions/pulls/134/comments","review_comment_url":"https://api.github.com/repos/CloudSlang/score-actions/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CloudSlang/score-actions/issues/134/comments","statuses_url":"https://api.github.com/repos/CloudSlang/score-actions/statuses/34b1cdf8d868f7f5551110c81dac3d78e4baaef5","head":{"label":"tethryus:master","ref":"master","sha":"34b1cdf8d868f7f5551110c81dac3d78e4baaef5","user":{"login":"tethryus","id":796864,"avatar_url":"https://avatars.githubusercontent.com/u/796864?v=3","gravatar_id":"","url":"https://api.github.com/users/tethryus","html_url":"https://github.com/tethryus","followers_url":"https://api.github.com/users/tethryus/followers","following_url":"https://api.github.com/users/tethryus/following{/other_user}","gists_url":"https://api.github.com/users/tethryus/gists{/gist_id}","starred_url":"https://api.github.com/users/tethryus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tethryus/subscriptions","organizations_url":"https://api.github.com/users/tethryus/orgs","repos_url":"https://api.github.com/users/tethryus/repos","events_url":"https://api.github.com/users/tethryus/events{/privacy}","received_events_url":"https://api.github.com/users/tethryus/received_events","type":"User","site_admin":false},"repo":{"id":55785216,"name":"score-actions","full_name":"tethryus/score-actions","owner":{"login":"tethryus","id":796864,"avatar_url":"https://avatars.githubusercontent.com/u/796864?v=3","gravatar_id":"","url":"https://api.github.com/users/tethryus","html_url":"https://github.com/tethryus","followers_url":"https://api.github.com/users/tethryus/followers","following_url":"https://api.github.com/users/tethryus/following{/other_user}","gists_url":"https://api.github.com/users/tethryus/gists{/gist_id}","starred_url":"https://api.github.com/users/tethryus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tethryus/subscriptions","organizations_url":"https://api.github.com/users/tethryus/orgs","repos_url":"https://api.github.com/users/tethryus/repos","events_url":"https://api.github.com/users/tethryus/events{/privacy}","received_events_url":"https://api.github.com/users/tethryus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tethryus/score-actions","description":"CloudSlang Content Java Actions","fork":true,"url":"https://api.github.com/repos/tethryus/score-actions","forks_url":"https://api.github.com/repos/tethryus/score-actions/forks","keys_url":"https://api.github.com/repos/tethryus/score-actions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tethryus/score-actions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tethryus/score-actions/teams","hooks_url":"https://api.github.com/repos/tethryus/score-actions/hooks","issue_events_url":"https://api.github.com/repos/tethryus/score-actions/issues/events{/number}","events_url":"https://api.github.com/repos/tethryus/score-actions/events","assignees_url":"https://api.github.com/repos/tethryus/score-actions/assignees{/user}","branches_url":"https://api.github.com/repos/tethryus/score-actions/branches{/branch}","tags_url":"https://api.github.com/repos/tethryus/score-actions/tags","blobs_url":"https://api.github.com/repos/tethryus/score-actions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tethryus/score-actions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tethryus/score-actions/git/refs{/sha}","trees_url":"https://api.github.com/repos/tethryus/score-actions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tethryus/score-actions/statuses/{sha}","languages_url":"https://api.github.com/repos/tethryus/score-actions/languages","stargazers_url":"https://api.github.com/repos/tethryus/score-actions/stargazers","contributors_url":"https://api.github.com/repos/tethryus/score-actions/contributors","subscribers_url":"https://api.github.com/repos/tethryus/score-actions/subscribers","subscription_url":"https://api.github.com/repos/tethryus/score-actions/subscription","commits_url":"https://api.github.com/repos/tethryus/score-actions/commits{/sha}","git_commits_url":"https://api.github.com/repos/tethryus/score-actions/git/commits{/sha}","comments_url":"https://api.github.com/repos/tethryus/score-actions/comments{/number}","issue_comment_url":"https://api.github.com/repos/tethryus/score-actions/issues/comments{/number}","contents_url":"https://api.github.com/repos/tethryus/score-actions/contents/{+path}","compare_url":"https://api.github.com/repos/tethryus/score-actions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tethryus/score-actions/merges","archive_url":"https://api.github.com/repos/tethryus/score-actions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tethryus/score-actions/downloads","issues_url":"https://api.github.com/repos/tethryus/score-actions/issues{/number}","pulls_url":"https://api.github.com/repos/tethryus/score-actions/pulls{/number}","milestones_url":"https://api.github.com/repos/tethryus/score-actions/milestones{/number}","notifications_url":"https://api.github.com/repos/tethryus/score-actions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tethryus/score-actions/labels{/name}","releases_url":"https://api.github.com/repos/tethryus/score-actions/releases{/id}","deployments_url":"https://api.github.com/repos/tethryus/score-actions/deployments","created_at":"2016-04-08T14:30:03Z","updated_at":"2016-04-08T14:30:06Z","pushed_at":"2016-07-08T22:44:45Z","git_url":"git://github.com/tethryus/score-actions.git","ssh_url":"git@github.com:tethryus/score-actions.git","clone_url":"https://github.com/tethryus/score-actions.git","svn_url":"https://github.com/tethryus/score-actions","homepage":"","size":2250,"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":"CloudSlang:master","ref":"master","sha":"370320458caec051cec840216758f6fece8d1d84","user":{"login":"CloudSlang","id":10261505,"avatar_url":"https://avatars.githubusercontent.com/u/10261505?v=3","gravatar_id":"","url":"https://api.github.com/users/CloudSlang","html_url":"https://github.com/CloudSlang","followers_url":"https://api.github.com/users/CloudSlang/followers","following_url":"https://api.github.com/users/CloudSlang/following{/other_user}","gists_url":"https://api.github.com/users/CloudSlang/gists{/gist_id}","starred_url":"https://api.github.com/users/CloudSlang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CloudSlang/subscriptions","organizations_url":"https://api.github.com/users/CloudSlang/orgs","repos_url":"https://api.github.com/users/CloudSlang/repos","events_url":"https://api.github.com/users/CloudSlang/events{/privacy}","received_events_url":"https://api.github.com/users/CloudSlang/received_events","type":"Organization","site_admin":false},"repo":{"id":28305374,"name":"score-actions","full_name":"CloudSlang/score-actions","owner":{"login":"CloudSlang","id":10261505,"avatar_url":"https://avatars.githubusercontent.com/u/10261505?v=3","gravatar_id":"","url":"https://api.github.com/users/CloudSlang","html_url":"https://github.com/CloudSlang","followers_url":"https://api.github.com/users/CloudSlang/followers","following_url":"https://api.github.com/users/CloudSlang/following{/other_user}","gists_url":"https://api.github.com/users/CloudSlang/gists{/gist_id}","starred_url":"https://api.github.com/users/CloudSlang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CloudSlang/subscriptions","organizations_url":"https://api.github.com/users/CloudSlang/orgs","repos_url":"https://api.github.com/users/CloudSlang/repos","events_url":"https://api.github.com/users/CloudSlang/events{/privacy}","received_events_url":"https://api.github.com/users/CloudSlang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CloudSlang/score-actions","description":"CloudSlang Content Java Actions","fork":false,"url":"https://api.github.com/repos/CloudSlang/score-actions","forks_url":"https://api.github.com/repos/CloudSlang/score-actions/forks","keys_url":"https://api.github.com/repos/CloudSlang/score-actions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CloudSlang/score-actions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CloudSlang/score-actions/teams","hooks_url":"https://api.github.com/repos/CloudSlang/score-actions/hooks","issue_events_url":"https://api.github.com/repos/CloudSlang/score-actions/issues/events{/number}","events_url":"https://api.github.com/repos/CloudSlang/score-actions/events","assignees_url":"https://api.github.com/repos/CloudSlang/score-actions/assignees{/user}","branches_url":"https://api.github.com/repos/CloudSlang/score-actions/branches{/branch}","tags_url":"https://api.github.com/repos/CloudSlang/score-actions/tags","blobs_url":"https://api.github.com/repos/CloudSlang/score-actions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CloudSlang/score-actions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CloudSlang/score-actions/git/refs{/sha}","trees_url":"https://api.github.com/repos/CloudSlang/score-actions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CloudSlang/score-actions/statuses/{sha}","languages_url":"https://api.github.com/repos/CloudSlang/score-actions/languages","stargazers_url":"https://api.github.com/repos/CloudSlang/score-actions/stargazers","contributors_url":"https://api.github.com/repos/CloudSlang/score-actions/contributors","subscribers_url":"https://api.github.com/repos/CloudSlang/score-actions/subscribers","subscription_url":"https://api.github.com/repos/CloudSlang/score-actions/subscription","commits_url":"https://api.github.com/repos/CloudSlang/score-actions/commits{/sha}","git_commits_url":"https://api.github.com/repos/CloudSlang/score-actions/git/commits{/sha}","comments_url":"https://api.github.com/repos/CloudSlang/score-actions/comments{/number}","issue_comment_url":"https://api.github.com/repos/CloudSlang/score-actions/issues/comments{/number}","contents_url":"https://api.github.com/repos/CloudSlang/score-actions/contents/{+path}","compare_url":"https://api.github.com/repos/CloudSlang/score-actions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CloudSlang/score-actions/merges","archive_url":"https://api.github.com/repos/CloudSlang/score-actions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CloudSlang/score-actions/downloads","issues_url":"https://api.github.com/repos/CloudSlang/score-actions/issues{/number}","pulls_url":"https://api.github.com/repos/CloudSlang/score-actions/pulls{/number}","milestones_url":"https://api.github.com/repos/CloudSlang/score-actions/milestones{/number}","notifications_url":"https://api.github.com/repos/CloudSlang/score-actions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CloudSlang/score-actions/labels{/name}","releases_url":"https://api.github.com/repos/CloudSlang/score-actions/releases{/id}","deployments_url":"https://api.github.com/repos/CloudSlang/score-actions/deployments","created_at":"2014-12-21T16:30:37Z","updated_at":"2016-07-01T17:36:47Z","pushed_at":"2016-07-08T22:44:45Z","git_url":"git://github.com/CloudSlang/score-actions.git","ssh_url":"git@github.com:CloudSlang/score-actions.git","clone_url":"https://github.com/CloudSlang/score-actions.git","svn_url":"https://github.com/CloudSlang/score-actions","homepage":"","size":3030,"stargazers_count":26,"watchers_count":26,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":7,"forks":26,"open_issues":7,"watchers":26,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CloudSlang/score-actions/pulls/134"},"html":{"href":"https://github.com/CloudSlang/score-actions/pull/134"},"issue":{"href":"https://api.github.com/repos/CloudSlang/score-actions/issues/134"},"comments":{"href":"https://api.github.com/repos/CloudSlang/score-actions/issues/134/comments"},"review_comments":{"href":"https://api.github.com/repos/CloudSlang/score-actions/pulls/134/comments"},"review_comment":{"href":"https://api.github.com/repos/CloudSlang/score-actions/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CloudSlang/score-actions/pulls/134/commits"},"statuses":{"href":"https://api.github.com/repos/CloudSlang/score-actions/statuses/34b1cdf8d868f7f5551110c81dac3d78e4baaef5"}}}}
{"actor":{"display_login":"tethryus"}}