{"action":"created","comment":{"url":"https://api.github.com/repos/allenai/common/pulls/comments/61342162","id":61342162,"diff_hunk":"@@ -0,0 +1,73 @@\n+package org.allenai.common\n+\n+import _root_.au.com.bytecode.opencsv.CSVReader\n+\n+import java.io._\n+\n+import scala.collection.JavaConverters._\n+import scala.io.{ BufferedSource, Codec, Source }\n+\n+/** Various convenient utilities for reading files and resources. */\n+object FileUtils extends Logging {\n+\n+  /** Get a file as a buffered source. */\n+  def getFileAsSource(file: File, codecOpt: Option[Codec] = None): BufferedSource = {\n+    codecOpt match {\n+      case Some(codec) => Source.fromFile(file)(codec)\n+      case None => Source.fromFile(file)\n+    }\n+  }\n+\n+  /** Get a file as a sequence of lines. */","path":"core/src/main/scala/org/allenai/common/FileUtils.scala","position":21,"original_position":21,"commit_id":"8771731da0bf9c46b6956a481a2396889fbc1997","original_commit_id":"8771731da0bf9c46b6956a481a2396889fbc1997","user":{"login":"ashish33","id":7505296,"avatar_url":"https://avatars.githubusercontent.com/u/7505296?v=3","gravatar_id":"","url":"https://api.github.com/users/ashish33","html_url":"https://github.com/ashish33","followers_url":"https://api.github.com/users/ashish33/followers","following_url":"https://api.github.com/users/ashish33/following{/other_user}","gists_url":"https://api.github.com/users/ashish33/gists{/gist_id}","starred_url":"https://api.github.com/users/ashish33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashish33/subscriptions","organizations_url":"https://api.github.com/users/ashish33/orgs","repos_url":"https://api.github.com/users/ashish33/repos","events_url":"https://api.github.com/users/ashish33/events{/privacy}","received_events_url":"https://api.github.com/users/ashish33/received_events","type":"User","site_admin":false},"body":"Good point.  Done here and elsewhere.","created_at":"2016-04-27T21:45:38Z","updated_at":"2016-04-27T21:45:38Z","html_url":"https://github.com/allenai/common/pull/189#discussion_r61342162","pull_request_url":"https://api.github.com/repos/allenai/common/pulls/189","_links":{"self":{"href":"https://api.github.com/repos/allenai/common/pulls/comments/61342162"},"html":{"href":"https://github.com/allenai/common/pull/189#discussion_r61342162"},"pull_request":{"href":"https://api.github.com/repos/allenai/common/pulls/189"}}},"pull_request":{"url":"https://api.github.com/repos/allenai/common/pulls/189","id":68108538,"html_url":"https://github.com/allenai/common/pull/189","diff_url":"https://github.com/allenai/common/pull/189.diff","patch_url":"https://github.com/allenai/common/pull/189.patch","issue_url":"https://api.github.com/repos/allenai/common/issues/189","number":189,"state":"open","locked":false,"title":"Consolidate a few commonly used utility methods","user":{"login":"ashish33","id":7505296,"avatar_url":"https://avatars.githubusercontent.com/u/7505296?v=3","gravatar_id":"","url":"https://api.github.com/users/ashish33","html_url":"https://github.com/ashish33","followers_url":"https://api.github.com/users/ashish33/followers","following_url":"https://api.github.com/users/ashish33/following{/other_user}","gists_url":"https://api.github.com/users/ashish33/gists{/gist_id}","starred_url":"https://api.github.com/users/ashish33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashish33/subscriptions","organizations_url":"https://api.github.com/users/ashish33/orgs","repos_url":"https://api.github.com/users/ashish33/repos","events_url":"https://api.github.com/users/ashish33/events{/privacy}","received_events_url":"https://api.github.com/users/ashish33/received_events","type":"User","site_admin":false},"body":"@jkinkead Following up on our chat, moving some handy utility methods (useful at least for multiple Aristo solvers) to this common location.","created_at":"2016-04-27T19:14:23Z","updated_at":"2016-04-27T21:45:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"85188431a27a35dba89de3ee5771c01c3452f68c","assignee":{"login":"jkinkead","id":1548392,"avatar_url":"https://avatars.githubusercontent.com/u/1548392?v=3","gravatar_id":"","url":"https://api.github.com/users/jkinkead","html_url":"https://github.com/jkinkead","followers_url":"https://api.github.com/users/jkinkead/followers","following_url":"https://api.github.com/users/jkinkead/following{/other_user}","gists_url":"https://api.github.com/users/jkinkead/gists{/gist_id}","starred_url":"https://api.github.com/users/jkinkead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkinkead/subscriptions","organizations_url":"https://api.github.com/users/jkinkead/orgs","repos_url":"https://api.github.com/users/jkinkead/repos","events_url":"https://api.github.com/users/jkinkead/events{/privacy}","received_events_url":"https://api.github.com/users/jkinkead/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/allenai/common/pulls/189/commits","review_comments_url":"https://api.github.com/repos/allenai/common/pulls/189/comments","review_comment_url":"https://api.github.com/repos/allenai/common/pulls/comments{/number}","comments_url":"https://api.github.com/repos/allenai/common/issues/189/comments","statuses_url":"https://api.github.com/repos/allenai/common/statuses/8771731da0bf9c46b6956a481a2396889fbc1997","head":{"label":"ashish33:add-utils","ref":"add-utils","sha":"8771731da0bf9c46b6956a481a2396889fbc1997","user":{"login":"ashish33","id":7505296,"avatar_url":"https://avatars.githubusercontent.com/u/7505296?v=3","gravatar_id":"","url":"https://api.github.com/users/ashish33","html_url":"https://github.com/ashish33","followers_url":"https://api.github.com/users/ashish33/followers","following_url":"https://api.github.com/users/ashish33/following{/other_user}","gists_url":"https://api.github.com/users/ashish33/gists{/gist_id}","starred_url":"https://api.github.com/users/ashish33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashish33/subscriptions","organizations_url":"https://api.github.com/users/ashish33/orgs","repos_url":"https://api.github.com/users/ashish33/repos","events_url":"https://api.github.com/users/ashish33/events{/privacy}","received_events_url":"https://api.github.com/users/ashish33/received_events","type":"User","site_admin":false},"repo":{"id":57236389,"name":"common","full_name":"ashish33/common","owner":{"login":"ashish33","id":7505296,"avatar_url":"https://avatars.githubusercontent.com/u/7505296?v=3","gravatar_id":"","url":"https://api.github.com/users/ashish33","html_url":"https://github.com/ashish33","followers_url":"https://api.github.com/users/ashish33/followers","following_url":"https://api.github.com/users/ashish33/following{/other_user}","gists_url":"https://api.github.com/users/ashish33/gists{/gist_id}","starred_url":"https://api.github.com/users/ashish33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashish33/subscriptions","organizations_url":"https://api.github.com/users/ashish33/orgs","repos_url":"https://api.github.com/users/ashish33/repos","events_url":"https://api.github.com/users/ashish33/events{/privacy}","received_events_url":"https://api.github.com/users/ashish33/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ashish33/common","description":"A collection of useful utility classes and functions.","fork":true,"url":"https://api.github.com/repos/ashish33/common","forks_url":"https://api.github.com/repos/ashish33/common/forks","keys_url":"https://api.github.com/repos/ashish33/common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ashish33/common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ashish33/common/teams","hooks_url":"https://api.github.com/repos/ashish33/common/hooks","issue_events_url":"https://api.github.com/repos/ashish33/common/issues/events{/number}","events_url":"https://api.github.com/repos/ashish33/common/events","assignees_url":"https://api.github.com/repos/ashish33/common/assignees{/user}","branches_url":"https://api.github.com/repos/ashish33/common/branches{/branch}","tags_url":"https://api.github.com/repos/ashish33/common/tags","blobs_url":"https://api.github.com/repos/ashish33/common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ashish33/common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ashish33/common/git/refs{/sha}","trees_url":"https://api.github.com/repos/ashish33/common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ashish33/common/statuses/{sha}","languages_url":"https://api.github.com/repos/ashish33/common/languages","stargazers_url":"https://api.github.com/repos/ashish33/common/stargazers","contributors_url":"https://api.github.com/repos/ashish33/common/contributors","subscribers_url":"https://api.github.com/repos/ashish33/common/subscribers","subscription_url":"https://api.github.com/repos/ashish33/common/subscription","commits_url":"https://api.github.com/repos/ashish33/common/commits{/sha}","git_commits_url":"https://api.github.com/repos/ashish33/common/git/commits{/sha}","comments_url":"https://api.github.com/repos/ashish33/common/comments{/number}","issue_comment_url":"https://api.github.com/repos/ashish33/common/issues/comments{/number}","contents_url":"https://api.github.com/repos/ashish33/common/contents/{+path}","compare_url":"https://api.github.com/repos/ashish33/common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ashish33/common/merges","archive_url":"https://api.github.com/repos/ashish33/common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ashish33/common/downloads","issues_url":"https://api.github.com/repos/ashish33/common/issues{/number}","pulls_url":"https://api.github.com/repos/ashish33/common/pulls{/number}","milestones_url":"https://api.github.com/repos/ashish33/common/milestones{/number}","notifications_url":"https://api.github.com/repos/ashish33/common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ashish33/common/labels{/name}","releases_url":"https://api.github.com/repos/ashish33/common/releases{/id}","deployments_url":"https://api.github.com/repos/ashish33/common/deployments","created_at":"2016-04-27T18:27:08Z","updated_at":"2016-04-27T18:27:09Z","pushed_at":"2016-04-27T19:13:56Z","git_url":"git://github.com/ashish33/common.git","ssh_url":"git@github.com:ashish33/common.git","clone_url":"https://github.com/ashish33/common.git","svn_url":"https://github.com/ashish33/common","homepage":null,"size":23756,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"allenai:master","ref":"master","sha":"6173fac4b2e0cb00d2fa1e6b50bcc591c1173e6d","user":{"login":"allenai","id":5667695,"avatar_url":"https://avatars.githubusercontent.com/u/5667695?v=3","gravatar_id":"","url":"https://api.github.com/users/allenai","html_url":"https://github.com/allenai","followers_url":"https://api.github.com/users/allenai/followers","following_url":"https://api.github.com/users/allenai/following{/other_user}","gists_url":"https://api.github.com/users/allenai/gists{/gist_id}","starred_url":"https://api.github.com/users/allenai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allenai/subscriptions","organizations_url":"https://api.github.com/users/allenai/orgs","repos_url":"https://api.github.com/users/allenai/repos","events_url":"https://api.github.com/users/allenai/events{/privacy}","received_events_url":"https://api.github.com/users/allenai/received_events","type":"Organization","site_admin":false},"repo":{"id":15063788,"name":"common","full_name":"allenai/common","owner":{"login":"allenai","id":5667695,"avatar_url":"https://avatars.githubusercontent.com/u/5667695?v=3","gravatar_id":"","url":"https://api.github.com/users/allenai","html_url":"https://github.com/allenai","followers_url":"https://api.github.com/users/allenai/followers","following_url":"https://api.github.com/users/allenai/following{/other_user}","gists_url":"https://api.github.com/users/allenai/gists{/gist_id}","starred_url":"https://api.github.com/users/allenai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allenai/subscriptions","organizations_url":"https://api.github.com/users/allenai/orgs","repos_url":"https://api.github.com/users/allenai/repos","events_url":"https://api.github.com/users/allenai/events{/privacy}","received_events_url":"https://api.github.com/users/allenai/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/allenai/common","description":"A collection of useful utility classes and functions.","fork":false,"url":"https://api.github.com/repos/allenai/common","forks_url":"https://api.github.com/repos/allenai/common/forks","keys_url":"https://api.github.com/repos/allenai/common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/allenai/common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/allenai/common/teams","hooks_url":"https://api.github.com/repos/allenai/common/hooks","issue_events_url":"https://api.github.com/repos/allenai/common/issues/events{/number}","events_url":"https://api.github.com/repos/allenai/common/events","assignees_url":"https://api.github.com/repos/allenai/common/assignees{/user}","branches_url":"https://api.github.com/repos/allenai/common/branches{/branch}","tags_url":"https://api.github.com/repos/allenai/common/tags","blobs_url":"https://api.github.com/repos/allenai/common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/allenai/common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/allenai/common/git/refs{/sha}","trees_url":"https://api.github.com/repos/allenai/common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/allenai/common/statuses/{sha}","languages_url":"https://api.github.com/repos/allenai/common/languages","stargazers_url":"https://api.github.com/repos/allenai/common/stargazers","contributors_url":"https://api.github.com/repos/allenai/common/contributors","subscribers_url":"https://api.github.com/repos/allenai/common/subscribers","subscription_url":"https://api.github.com/repos/allenai/common/subscription","commits_url":"https://api.github.com/repos/allenai/common/commits{/sha}","git_commits_url":"https://api.github.com/repos/allenai/common/git/commits{/sha}","comments_url":"https://api.github.com/repos/allenai/common/comments{/number}","issue_comment_url":"https://api.github.com/repos/allenai/common/issues/comments{/number}","contents_url":"https://api.github.com/repos/allenai/common/contents/{+path}","compare_url":"https://api.github.com/repos/allenai/common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/allenai/common/merges","archive_url":"https://api.github.com/repos/allenai/common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/allenai/common/downloads","issues_url":"https://api.github.com/repos/allenai/common/issues{/number}","pulls_url":"https://api.github.com/repos/allenai/common/pulls{/number}","milestones_url":"https://api.github.com/repos/allenai/common/milestones{/number}","notifications_url":"https://api.github.com/repos/allenai/common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/allenai/common/labels{/name}","releases_url":"https://api.github.com/repos/allenai/common/releases{/id}","deployments_url":"https://api.github.com/repos/allenai/common/deployments","created_at":"2013-12-10T01:16:45Z","updated_at":"2016-03-31T12:42:03Z","pushed_at":"2016-04-27T19:14:23Z","git_url":"git://github.com/allenai/common.git","ssh_url":"git@github.com:allenai/common.git","clone_url":"https://github.com/allenai/common.git","svn_url":"https://github.com/allenai/common","homepage":null,"size":23796,"stargazers_count":2,"watchers_count":2,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":15,"mirror_url":null,"open_issues_count":11,"forks":15,"open_issues":11,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/allenai/common/pulls/189"},"html":{"href":"https://github.com/allenai/common/pull/189"},"issue":{"href":"https://api.github.com/repos/allenai/common/issues/189"},"comments":{"href":"https://api.github.com/repos/allenai/common/issues/189/comments"},"review_comments":{"href":"https://api.github.com/repos/allenai/common/pulls/189/comments"},"review_comment":{"href":"https://api.github.com/repos/allenai/common/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/allenai/common/pulls/189/commits"},"statuses":{"href":"https://api.github.com/repos/allenai/common/statuses/8771731da0bf9c46b6956a481a2396889fbc1997"}}}}