{"action":"created","comment":{"url":"https://api.github.com/repos/spotify/scio/pulls/comments/175169872","pull_request_review_id":104663332,"id":175169872,"diff_hunk":"@@ -0,0 +1,46 @@\n+/*\n+ * Copyright 2018 Spotify AB.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing,\n+ * software distributed under the License is distributed on an\n+ * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+ * KIND, either express or implied.  See the License for the\n+ * specific language governing permissions and limitations\n+ * under the License.\n+ */\n+\n+package com.spotify.scio\n+\n+import org.apache.beam.sdk.io.{DefaultFilenamePolicy, FileBasedSink}\n+import org.apache.beam.sdk.io.fs.ResourceId\n+import org.apache.beam.sdk.options.ValueProvider.StaticValueProvider\n+\n+object JavaConverters {\n+\n+  implicit class RichString(s: String) {\n+    def toResourceId(): ResourceId = FileBasedSink.convertToFileResourceIfPossible(s)\n+    def toFilenamePolicy: DefaultFilenamePolicy = DefaultFilenamePolicy.fromStandardParameters(\n+        StaticValueProvider.of(s.toResourceId()), null, null, false)\n+  }\n+\n+  case class FilenamePolicy(baseFilename: String,\n+                            shardTemplate: String = null,\n+                            templateSuffix: String = null,\n+                            windowedWrites: Boolean = false)\n+\n+  implicit class RichFilenamePolicy(policy: FilenamePolicy) {\n+    def toJava(): DefaultFilenamePolicy = DefaultFilenamePolicy.fromStandardParameters(","path":"scio-core/src/main/scala/com/spotify/scio/JavaConverters.scala","position":38,"original_position":38,"commit_id":"3e327d8662e86fcc78f3cb225607642a1e05a52c","original_commit_id":"a4f1de5e36a76da3e76ca262a88f26928ae49dfb","user":{"login":"nevillelyh","id":468514,"avatar_url":"https://avatars0.githubusercontent.com/u/468514?v=4","gravatar_id":"","url":"https://api.github.com/users/nevillelyh","html_url":"https://github.com/nevillelyh","followers_url":"https://api.github.com/users/nevillelyh/followers","following_url":"https://api.github.com/users/nevillelyh/following{/other_user}","gists_url":"https://api.github.com/users/nevillelyh/gists{/gist_id}","starred_url":"https://api.github.com/users/nevillelyh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nevillelyh/subscriptions","organizations_url":"https://api.github.com/users/nevillelyh/orgs","repos_url":"https://api.github.com/users/nevillelyh/repos","events_url":"https://api.github.com/users/nevillelyh/events{/privacy}","received_events_url":"https://api.github.com/users/nevillelyh/received_events","type":"User","site_admin":false},"body":"Also nitpicking: call it `asJava` to be consistent with collection converters?","created_at":"2018-03-16T17:56:11Z","updated_at":"2018-03-16T17:56:11Z","html_url":"https://github.com/spotify/scio/pull/1076#discussion_r175169872","pull_request_url":"https://api.github.com/repos/spotify/scio/pulls/1076","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/spotify/scio/pulls/comments/175169872"},"html":{"href":"https://github.com/spotify/scio/pull/1076#discussion_r175169872"},"pull_request":{"href":"https://api.github.com/repos/spotify/scio/pulls/1076"}},"in_reply_to_id":174266516},"pull_request":{"url":"https://api.github.com/repos/spotify/scio/pulls/1076","id":174499868,"html_url":"https://github.com/spotify/scio/pull/1076","diff_url":"https://github.com/spotify/scio/pull/1076.diff","patch_url":"https://github.com/spotify/scio/pull/1076.patch","issue_url":"https://api.github.com/repos/spotify/scio/issues/1076","number":1076,"state":"open","locked":false,"title":"First Stab at Java Converters","user":{"login":"jpvelez","id":533641,"avatar_url":"https://avatars1.githubusercontent.com/u/533641?v=4","gravatar_id":"","url":"https://api.github.com/users/jpvelez","html_url":"https://github.com/jpvelez","followers_url":"https://api.github.com/users/jpvelez/followers","following_url":"https://api.github.com/users/jpvelez/following{/other_user}","gists_url":"https://api.github.com/users/jpvelez/gists{/gist_id}","starred_url":"https://api.github.com/users/jpvelez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpvelez/subscriptions","organizations_url":"https://api.github.com/users/jpvelez/orgs","repos_url":"https://api.github.com/users/jpvelez/repos","events_url":"https://api.github.com/users/jpvelez/events{/privacy}","received_events_url":"https://api.github.com/users/jpvelez/received_events","type":"User","site_admin":false},"body":"Implemented Java Converters (#1013) for Beam file abstractions `ResourceId` and `FilenamePolicy`. This isn't finished code, just trying out an approach.\r\n\r\n@nevillelyh please let me know if this is the direction you had in mind.","created_at":"2018-03-12T21:28:17Z","updated_at":"2018-03-16T17:56:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"708bfbabbd19c945872fe7d46d7403df350f067d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/spotify/scio/pulls/1076/commits","review_comments_url":"https://api.github.com/repos/spotify/scio/pulls/1076/comments","review_comment_url":"https://api.github.com/repos/spotify/scio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spotify/scio/issues/1076/comments","statuses_url":"https://api.github.com/repos/spotify/scio/statuses/3e327d8662e86fcc78f3cb225607642a1e05a52c","head":{"label":"spotify:jpvelez/java-converters","ref":"jpvelez/java-converters","sha":"3e327d8662e86fcc78f3cb225607642a1e05a52c","user":{"login":"spotify","id":251374,"avatar_url":"https://avatars2.githubusercontent.com/u/251374?v=4","gravatar_id":"","url":"https://api.github.com/users/spotify","html_url":"https://github.com/spotify","followers_url":"https://api.github.com/users/spotify/followers","following_url":"https://api.github.com/users/spotify/following{/other_user}","gists_url":"https://api.github.com/users/spotify/gists{/gist_id}","starred_url":"https://api.github.com/users/spotify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spotify/subscriptions","organizations_url":"https://api.github.com/users/spotify/orgs","repos_url":"https://api.github.com/users/spotify/repos","events_url":"https://api.github.com/users/spotify/events{/privacy}","received_events_url":"https://api.github.com/users/spotify/received_events","type":"Organization","site_admin":false},"repo":{"id":32946662,"name":"scio","full_name":"spotify/scio","owner":{"login":"spotify","id":251374,"avatar_url":"https://avatars2.githubusercontent.com/u/251374?v=4","gravatar_id":"","url":"https://api.github.com/users/spotify","html_url":"https://github.com/spotify","followers_url":"https://api.github.com/users/spotify/followers","following_url":"https://api.github.com/users/spotify/following{/other_user}","gists_url":"https://api.github.com/users/spotify/gists{/gist_id}","starred_url":"https://api.github.com/users/spotify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spotify/subscriptions","organizations_url":"https://api.github.com/users/spotify/orgs","repos_url":"https://api.github.com/users/spotify/repos","events_url":"https://api.github.com/users/spotify/events{/privacy}","received_events_url":"https://api.github.com/users/spotify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spotify/scio","description":"A Scala API for Apache Beam and Google Cloud Dataflow.","fork":false,"url":"https://api.github.com/repos/spotify/scio","forks_url":"https://api.github.com/repos/spotify/scio/forks","keys_url":"https://api.github.com/repos/spotify/scio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spotify/scio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spotify/scio/teams","hooks_url":"https://api.github.com/repos/spotify/scio/hooks","issue_events_url":"https://api.github.com/repos/spotify/scio/issues/events{/number}","events_url":"https://api.github.com/repos/spotify/scio/events","assignees_url":"https://api.github.com/repos/spotify/scio/assignees{/user}","branches_url":"https://api.github.com/repos/spotify/scio/branches{/branch}","tags_url":"https://api.github.com/repos/spotify/scio/tags","blobs_url":"https://api.github.com/repos/spotify/scio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spotify/scio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spotify/scio/git/refs{/sha}","trees_url":"https://api.github.com/repos/spotify/scio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spotify/scio/statuses/{sha}","languages_url":"https://api.github.com/repos/spotify/scio/languages","stargazers_url":"https://api.github.com/repos/spotify/scio/stargazers","contributors_url":"https://api.github.com/repos/spotify/scio/contributors","subscribers_url":"https://api.github.com/repos/spotify/scio/subscribers","subscription_url":"https://api.github.com/repos/spotify/scio/subscription","commits_url":"https://api.github.com/repos/spotify/scio/commits{/sha}","git_commits_url":"https://api.github.com/repos/spotify/scio/git/commits{/sha}","comments_url":"https://api.github.com/repos/spotify/scio/comments{/number}","issue_comment_url":"https://api.github.com/repos/spotify/scio/issues/comments{/number}","contents_url":"https://api.github.com/repos/spotify/scio/contents/{+path}","compare_url":"https://api.github.com/repos/spotify/scio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spotify/scio/merges","archive_url":"https://api.github.com/repos/spotify/scio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spotify/scio/downloads","issues_url":"https://api.github.com/repos/spotify/scio/issues{/number}","pulls_url":"https://api.github.com/repos/spotify/scio/pulls{/number}","milestones_url":"https://api.github.com/repos/spotify/scio/milestones{/number}","notifications_url":"https://api.github.com/repos/spotify/scio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spotify/scio/labels{/name}","releases_url":"https://api.github.com/repos/spotify/scio/releases{/id}","deployments_url":"https://api.github.com/repos/spotify/scio/deployments","created_at":"2015-03-26T19:07:34Z","updated_at":"2018-03-16T17:41:41Z","pushed_at":"2018-03-16T17:38:32Z","git_url":"git://github.com/spotify/scio.git","ssh_url":"git@github.com:spotify/scio.git","clone_url":"https://github.com/spotify/scio.git","svn_url":"https://github.com/spotify/scio","homepage":"http://spotify.github.io/scio","size":8930,"stargazers_count":952,"watchers_count":952,"language":"Scala","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":156,"mirror_url":null,"archived":false,"open_issues_count":50,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":156,"open_issues":50,"watchers":952,"default_branch":"master"}},"base":{"label":"spotify:master","ref":"master","sha":"3a5b445b1551697d76137679032fdb9d950a38f6","user":{"login":"spotify","id":251374,"avatar_url":"https://avatars2.githubusercontent.com/u/251374?v=4","gravatar_id":"","url":"https://api.github.com/users/spotify","html_url":"https://github.com/spotify","followers_url":"https://api.github.com/users/spotify/followers","following_url":"https://api.github.com/users/spotify/following{/other_user}","gists_url":"https://api.github.com/users/spotify/gists{/gist_id}","starred_url":"https://api.github.com/users/spotify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spotify/subscriptions","organizations_url":"https://api.github.com/users/spotify/orgs","repos_url":"https://api.github.com/users/spotify/repos","events_url":"https://api.github.com/users/spotify/events{/privacy}","received_events_url":"https://api.github.com/users/spotify/received_events","type":"Organization","site_admin":false},"repo":{"id":32946662,"name":"scio","full_name":"spotify/scio","owner":{"login":"spotify","id":251374,"avatar_url":"https://avatars2.githubusercontent.com/u/251374?v=4","gravatar_id":"","url":"https://api.github.com/users/spotify","html_url":"https://github.com/spotify","followers_url":"https://api.github.com/users/spotify/followers","following_url":"https://api.github.com/users/spotify/following{/other_user}","gists_url":"https://api.github.com/users/spotify/gists{/gist_id}","starred_url":"https://api.github.com/users/spotify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spotify/subscriptions","organizations_url":"https://api.github.com/users/spotify/orgs","repos_url":"https://api.github.com/users/spotify/repos","events_url":"https://api.github.com/users/spotify/events{/privacy}","received_events_url":"https://api.github.com/users/spotify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spotify/scio","description":"A Scala API for Apache Beam and Google Cloud Dataflow.","fork":false,"url":"https://api.github.com/repos/spotify/scio","forks_url":"https://api.github.com/repos/spotify/scio/forks","keys_url":"https://api.github.com/repos/spotify/scio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spotify/scio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spotify/scio/teams","hooks_url":"https://api.github.com/repos/spotify/scio/hooks","issue_events_url":"https://api.github.com/repos/spotify/scio/issues/events{/number}","events_url":"https://api.github.com/repos/spotify/scio/events","assignees_url":"https://api.github.com/repos/spotify/scio/assignees{/user}","branches_url":"https://api.github.com/repos/spotify/scio/branches{/branch}","tags_url":"https://api.github.com/repos/spotify/scio/tags","blobs_url":"https://api.github.com/repos/spotify/scio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spotify/scio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spotify/scio/git/refs{/sha}","trees_url":"https://api.github.com/repos/spotify/scio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spotify/scio/statuses/{sha}","languages_url":"https://api.github.com/repos/spotify/scio/languages","stargazers_url":"https://api.github.com/repos/spotify/scio/stargazers","contributors_url":"https://api.github.com/repos/spotify/scio/contributors","subscribers_url":"https://api.github.com/repos/spotify/scio/subscribers","subscription_url":"https://api.github.com/repos/spotify/scio/subscription","commits_url":"https://api.github.com/repos/spotify/scio/commits{/sha}","git_commits_url":"https://api.github.com/repos/spotify/scio/git/commits{/sha}","comments_url":"https://api.github.com/repos/spotify/scio/comments{/number}","issue_comment_url":"https://api.github.com/repos/spotify/scio/issues/comments{/number}","contents_url":"https://api.github.com/repos/spotify/scio/contents/{+path}","compare_url":"https://api.github.com/repos/spotify/scio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spotify/scio/merges","archive_url":"https://api.github.com/repos/spotify/scio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spotify/scio/downloads","issues_url":"https://api.github.com/repos/spotify/scio/issues{/number}","pulls_url":"https://api.github.com/repos/spotify/scio/pulls{/number}","milestones_url":"https://api.github.com/repos/spotify/scio/milestones{/number}","notifications_url":"https://api.github.com/repos/spotify/scio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spotify/scio/labels{/name}","releases_url":"https://api.github.com/repos/spotify/scio/releases{/id}","deployments_url":"https://api.github.com/repos/spotify/scio/deployments","created_at":"2015-03-26T19:07:34Z","updated_at":"2018-03-16T17:41:41Z","pushed_at":"2018-03-16T17:38:32Z","git_url":"git://github.com/spotify/scio.git","ssh_url":"git@github.com:spotify/scio.git","clone_url":"https://github.com/spotify/scio.git","svn_url":"https://github.com/spotify/scio","homepage":"http://spotify.github.io/scio","size":8930,"stargazers_count":952,"watchers_count":952,"language":"Scala","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":156,"mirror_url":null,"archived":false,"open_issues_count":50,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":156,"open_issues":50,"watchers":952,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spotify/scio/pulls/1076"},"html":{"href":"https://github.com/spotify/scio/pull/1076"},"issue":{"href":"https://api.github.com/repos/spotify/scio/issues/1076"},"comments":{"href":"https://api.github.com/repos/spotify/scio/issues/1076/comments"},"review_comments":{"href":"https://api.github.com/repos/spotify/scio/pulls/1076/comments"},"review_comment":{"href":"https://api.github.com/repos/spotify/scio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spotify/scio/pulls/1076/commits"},"statuses":{"href":"https://api.github.com/repos/spotify/scio/statuses/3e327d8662e86fcc78f3cb225607642a1e05a52c"}},"author_association":"NONE"}}
{"actor":{"display_login":"nevillelyh"}}