{"action":"created","comment":{"url":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/comments/45554068","id":45554068,"diff_hunk":"@@ -63,51 +62,45 @@ If you are unsure of what to set the value of ``sharedRoot`` to, consider the fo\n * If you plan on having multiple configuration files (complex plugins) in the future, set the value to ``false``.\n * If you plan on having a single configuration file (less-complex plugins), set the value to ``true``.\n \n+You can also obtain a ``Path`` instance pointing to the config directory instead of a particular file. Just\n+have it injected using the ``@ConfigDir`` annotation, either with ``sharedRoot`` set to ``false`` for a plugin specific\n+directory or to ``true`` to get the shared configuration directory.\n+\n+.. note::\n+\n+    While it may be possible to get a ``File`` instead of a ``Path``, configurate (and Sponge) recommend using ``Path``.\n \n **Example - Field using** ``@DefaultConfig``\n \n .. code-block:: java\n \n+    import java.nio.file.Path;\n     import com.google.inject.Inject;\n+    import org.spongepowered.api.service.config.ConfigDir;\n     import org.spongepowered.api.service.config.DefaultConfig;\n+    import ninja.leaping.configurate.commented.CommentedConfigurationNode;\n+    import ninja.leaping.configurate.loader.ConfigurationLoader;\n \n     @Inject\n     @DefaultConfig(sharedRoot = true)\n-    private File defaultConfig;\n+    private Path defaultConfig;\n \n     @Inject\n     @DefaultConfig(sharedRoot = true)\n     private ConfigurationLoader<CommentedConfigurationNode> configManager;\n \n+    @Inject\n+    @ConfigDir(sharedRoot = false)\n+    private Path privateConfigDir;\n+\n .. warning::\n \n-    When your plugin is running for the first time, the returned pathname may refer to a configuration file that does\n-    not yet exist.\n+    When your plugin is running for the first time, returned pathnames for configuration files and directories may not\n+    yet exist. If you delegate all reading / writing of files to configurate, you do not need to worry about inexistant\n+    paths as the library will handle them appropriatly.\n \n .. note::\n \n     The use of YAML format (http://yaml.org/spec/1.1/) is also supported, but the preferred config format for Sponge\n-    plugins is HOCON. Conversion from YAML to HOCON can be automated; a simple code snippet for converting a Bukkit\n-    plugin configuration folder with a dedicated data folder (sharedRoot = false) is provided below.\n-\n-.. code-block:: java\n-\n-    private void convertFromBukkit() throws IOException {\n-        File bukkitConfigDir = new File(\"plugins/\" + PomData.NAME);\n-        if (bukkitConfigDir.isDirectory() && !configDir.isDirectory()) {\n-        logger.info(lf(_(\"Migrating configuration data from Bukkit\")));\n-            if (!bukkitConfigDir.renameTo(configDir)) {\n-                throw new IOException(lf(_(\"Unable to move Bukkit configuration directory to location for Sponge!\")));\n-            }\n-        }\n-        File bukkitConfigFile = new File(configDir, \"config.yml\");\n-        if (bukkitConfigFile.isFile()) {\n-            ConfigurationLoader<ConfigurationNode> yamlReader =\n-              YAMLConfigurationLoader.builder().setFile(bukkitConfigFile).build();\n-            ConfigurationNode bukkitConfig = yamlReader.load();\n-            configLoader.save(bukkitConfig);\n-            if (!bukkitConfigFile.renameTo(new File(configDir, \"config.yml.bukkit\"))) {\n-                logger.warn(lf(_(\"Could not rename old Bukkit configuration file to old name\")));\n-            }\n-        }\n-    }\n+    plugins is HOCON. Conversion from YAML to HOCON can be automated by using one a ``YamlConfigurationLoader`` to load","path":"source/plugin/configuration/index.rst","position":99,"original_position":99,"commit_id":"4a026afd461fc5168bc9c42ea791c30d409059df","original_commit_id":"4a026afd461fc5168bc9c42ea791c30d409059df","user":{"login":"RobertHerhold","id":8069753,"avatar_url":"https://avatars.githubusercontent.com/u/8069753?v=3","gravatar_id":"","url":"https://api.github.com/users/RobertHerhold","html_url":"https://github.com/RobertHerhold","followers_url":"https://api.github.com/users/RobertHerhold/followers","following_url":"https://api.github.com/users/RobertHerhold/following{/other_user}","gists_url":"https://api.github.com/users/RobertHerhold/gists{/gist_id}","starred_url":"https://api.github.com/users/RobertHerhold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobertHerhold/subscriptions","organizations_url":"https://api.github.com/users/RobertHerhold/orgs","repos_url":"https://api.github.com/users/RobertHerhold/repos","events_url":"https://api.github.com/users/RobertHerhold/events{/privacy}","received_events_url":"https://api.github.com/users/RobertHerhold/received_events","type":"User","site_admin":false},"body":"take out 'one'","created_at":"2015-11-22T03:33:55Z","updated_at":"2015-11-22T03:33:55Z","html_url":"https://github.com/SpongePowered/SpongeDocs/pull/369#discussion_r45554068","pull_request_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/369","_links":{"self":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/comments/45554068"},"html":{"href":"https://github.com/SpongePowered/SpongeDocs/pull/369#discussion_r45554068"},"pull_request":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/369"}}},"pull_request":{"url":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/369","id":50067772,"html_url":"https://github.com/SpongePowered/SpongeDocs/pull/369","diff_url":"https://github.com/SpongePowered/SpongeDocs/pull/369.diff","patch_url":"https://github.com/SpongePowered/SpongeDocs/pull/369.patch","issue_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues/369","number":369,"state":"open","locked":false,"title":"Configuration cleanup","user":{"login":"saladoc","id":7555130,"avatar_url":"https://avatars.githubusercontent.com/u/7555130?v=3","gravatar_id":"","url":"https://api.github.com/users/saladoc","html_url":"https://github.com/saladoc","followers_url":"https://api.github.com/users/saladoc/followers","following_url":"https://api.github.com/users/saladoc/following{/other_user}","gists_url":"https://api.github.com/users/saladoc/gists{/gist_id}","starred_url":"https://api.github.com/users/saladoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saladoc/subscriptions","organizations_url":"https://api.github.com/users/saladoc/orgs","repos_url":"https://api.github.com/users/saladoc/repos","events_url":"https://api.github.com/users/saladoc/events{/privacy}","received_events_url":"https://api.github.com/users/saladoc/received_events","type":"User","site_admin":false},"body":"Configuration docs are rather messy now. [Deshts forum post](https://forums.spongepowered.org/t/object-serialization-what-am-i-missing/9708) showed some ways in which they were lacking and I'm pretty confident they can lose some fat in other places.","created_at":"2015-11-08T19:30:57Z","updated_at":"2015-11-22T03:33:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"de8c84190f20883ebecc6cc926878b2cc783ea85","assignee":{"login":"saladoc","id":7555130,"avatar_url":"https://avatars.githubusercontent.com/u/7555130?v=3","gravatar_id":"","url":"https://api.github.com/users/saladoc","html_url":"https://github.com/saladoc","followers_url":"https://api.github.com/users/saladoc/followers","following_url":"https://api.github.com/users/saladoc/following{/other_user}","gists_url":"https://api.github.com/users/saladoc/gists{/gist_id}","starred_url":"https://api.github.com/users/saladoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saladoc/subscriptions","organizations_url":"https://api.github.com/users/saladoc/orgs","repos_url":"https://api.github.com/users/saladoc/repos","events_url":"https://api.github.com/users/saladoc/events{/privacy}","received_events_url":"https://api.github.com/users/saladoc/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/SpongePowered/SpongeDocs/milestones/2","html_url":"https://github.com/SpongePowered/SpongeDocs/milestones/Essential%20BETA%20features","labels_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/milestones/2/labels","id":909730,"number":2,"title":"Essential BETA features","description":"The Docs should move towards completion so that plugin developers can easily use Sponge to make stuff. Hopefully we can get this done more or less synchronous with SpongeForge/SpongeVanilla BETA release.","creator":{"login":"Inscrutable","id":1009532,"avatar_url":"https://avatars.githubusercontent.com/u/1009532?v=3","gravatar_id":"","url":"https://api.github.com/users/Inscrutable","html_url":"https://github.com/Inscrutable","followers_url":"https://api.github.com/users/Inscrutable/followers","following_url":"https://api.github.com/users/Inscrutable/following{/other_user}","gists_url":"https://api.github.com/users/Inscrutable/gists{/gist_id}","starred_url":"https://api.github.com/users/Inscrutable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Inscrutable/subscriptions","organizations_url":"https://api.github.com/users/Inscrutable/orgs","repos_url":"https://api.github.com/users/Inscrutable/repos","events_url":"https://api.github.com/users/Inscrutable/events{/privacy}","received_events_url":"https://api.github.com/users/Inscrutable/received_events","type":"User","site_admin":false},"open_issues":14,"closed_issues":27,"state":"open","created_at":"2014-12-19T06:46:15Z","updated_at":"2015-11-19T19:22:10Z","due_on":"2015-12-30T13:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/369/commits","review_comments_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/369/comments","review_comment_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues/369/comments","statuses_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/statuses/4a026afd461fc5168bc9c42ea791c30d409059df","head":{"label":"SpongePowered:configuration-cleanup","ref":"configuration-cleanup","sha":"4a026afd461fc5168bc9c42ea791c30d409059df","user":{"login":"SpongePowered","id":8683473,"avatar_url":"https://avatars.githubusercontent.com/u/8683473?v=3","gravatar_id":"","url":"https://api.github.com/users/SpongePowered","html_url":"https://github.com/SpongePowered","followers_url":"https://api.github.com/users/SpongePowered/followers","following_url":"https://api.github.com/users/SpongePowered/following{/other_user}","gists_url":"https://api.github.com/users/SpongePowered/gists{/gist_id}","starred_url":"https://api.github.com/users/SpongePowered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpongePowered/subscriptions","organizations_url":"https://api.github.com/users/SpongePowered/orgs","repos_url":"https://api.github.com/users/SpongePowered/repos","events_url":"https://api.github.com/users/SpongePowered/events{/privacy}","received_events_url":"https://api.github.com/users/SpongePowered/received_events","type":"Organization","site_admin":false},"repo":{"id":27024702,"name":"SpongeDocs","full_name":"SpongePowered/SpongeDocs","owner":{"login":"SpongePowered","id":8683473,"avatar_url":"https://avatars.githubusercontent.com/u/8683473?v=3","gravatar_id":"","url":"https://api.github.com/users/SpongePowered","html_url":"https://github.com/SpongePowered","followers_url":"https://api.github.com/users/SpongePowered/followers","following_url":"https://api.github.com/users/SpongePowered/following{/other_user}","gists_url":"https://api.github.com/users/SpongePowered/gists{/gist_id}","starred_url":"https://api.github.com/users/SpongePowered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpongePowered/subscriptions","organizations_url":"https://api.github.com/users/SpongePowered/orgs","repos_url":"https://api.github.com/users/SpongePowered/repos","events_url":"https://api.github.com/users/SpongePowered/events{/privacy}","received_events_url":"https://api.github.com/users/SpongePowered/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SpongePowered/SpongeDocs","description":"Documentation for Sponge and its Implementations","fork":false,"url":"https://api.github.com/repos/SpongePowered/SpongeDocs","forks_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/forks","keys_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/teams","hooks_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/hooks","issue_events_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues/events{/number}","events_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/events","assignees_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/assignees{/user}","branches_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/branches{/branch}","tags_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/tags","blobs_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/refs{/sha}","trees_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/statuses/{sha}","languages_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/languages","stargazers_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/stargazers","contributors_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/contributors","subscribers_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/subscribers","subscription_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/subscription","commits_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/commits{/sha}","git_commits_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/commits{/sha}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/comments{/number}","issue_comment_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues/comments{/number}","contents_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/contents/{+path}","compare_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/merges","archive_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/downloads","issues_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues{/number}","pulls_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls{/number}","milestones_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/milestones{/number}","notifications_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/labels{/name}","releases_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/releases{/id}","created_at":"2014-11-23T06:56:04Z","updated_at":"2015-11-15T13:47:56Z","pushed_at":"2015-11-19T21:53:33Z","git_url":"git://github.com/SpongePowered/SpongeDocs.git","ssh_url":"git@github.com:SpongePowered/SpongeDocs.git","clone_url":"https://github.com/SpongePowered/SpongeDocs.git","svn_url":"https://github.com/SpongePowered/SpongeDocs","homepage":"","size":5556,"stargazers_count":46,"watchers_count":46,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":52,"mirror_url":null,"open_issues_count":50,"forks":52,"open_issues":50,"watchers":46,"default_branch":"master"}},"base":{"label":"SpongePowered:master","ref":"master","sha":"262a211270e92774541be3f5eb70caa7ac726ac0","user":{"login":"SpongePowered","id":8683473,"avatar_url":"https://avatars.githubusercontent.com/u/8683473?v=3","gravatar_id":"","url":"https://api.github.com/users/SpongePowered","html_url":"https://github.com/SpongePowered","followers_url":"https://api.github.com/users/SpongePowered/followers","following_url":"https://api.github.com/users/SpongePowered/following{/other_user}","gists_url":"https://api.github.com/users/SpongePowered/gists{/gist_id}","starred_url":"https://api.github.com/users/SpongePowered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpongePowered/subscriptions","organizations_url":"https://api.github.com/users/SpongePowered/orgs","repos_url":"https://api.github.com/users/SpongePowered/repos","events_url":"https://api.github.com/users/SpongePowered/events{/privacy}","received_events_url":"https://api.github.com/users/SpongePowered/received_events","type":"Organization","site_admin":false},"repo":{"id":27024702,"name":"SpongeDocs","full_name":"SpongePowered/SpongeDocs","owner":{"login":"SpongePowered","id":8683473,"avatar_url":"https://avatars.githubusercontent.com/u/8683473?v=3","gravatar_id":"","url":"https://api.github.com/users/SpongePowered","html_url":"https://github.com/SpongePowered","followers_url":"https://api.github.com/users/SpongePowered/followers","following_url":"https://api.github.com/users/SpongePowered/following{/other_user}","gists_url":"https://api.github.com/users/SpongePowered/gists{/gist_id}","starred_url":"https://api.github.com/users/SpongePowered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpongePowered/subscriptions","organizations_url":"https://api.github.com/users/SpongePowered/orgs","repos_url":"https://api.github.com/users/SpongePowered/repos","events_url":"https://api.github.com/users/SpongePowered/events{/privacy}","received_events_url":"https://api.github.com/users/SpongePowered/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SpongePowered/SpongeDocs","description":"Documentation for Sponge and its Implementations","fork":false,"url":"https://api.github.com/repos/SpongePowered/SpongeDocs","forks_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/forks","keys_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/teams","hooks_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/hooks","issue_events_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues/events{/number}","events_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/events","assignees_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/assignees{/user}","branches_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/branches{/branch}","tags_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/tags","blobs_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/refs{/sha}","trees_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/statuses/{sha}","languages_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/languages","stargazers_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/stargazers","contributors_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/contributors","subscribers_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/subscribers","subscription_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/subscription","commits_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/commits{/sha}","git_commits_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/git/commits{/sha}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/comments{/number}","issue_comment_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues/comments{/number}","contents_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/contents/{+path}","compare_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/merges","archive_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/downloads","issues_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues{/number}","pulls_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls{/number}","milestones_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/milestones{/number}","notifications_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/labels{/name}","releases_url":"https://api.github.com/repos/SpongePowered/SpongeDocs/releases{/id}","created_at":"2014-11-23T06:56:04Z","updated_at":"2015-11-15T13:47:56Z","pushed_at":"2015-11-19T21:53:33Z","git_url":"git://github.com/SpongePowered/SpongeDocs.git","ssh_url":"git@github.com:SpongePowered/SpongeDocs.git","clone_url":"https://github.com/SpongePowered/SpongeDocs.git","svn_url":"https://github.com/SpongePowered/SpongeDocs","homepage":"","size":5556,"stargazers_count":46,"watchers_count":46,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":52,"mirror_url":null,"open_issues_count":50,"forks":52,"open_issues":50,"watchers":46,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/369"},"html":{"href":"https://github.com/SpongePowered/SpongeDocs/pull/369"},"issue":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues/369"},"comments":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/issues/369/comments"},"review_comments":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/369/comments"},"review_comment":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/pulls/369/commits"},"statuses":{"href":"https://api.github.com/repos/SpongePowered/SpongeDocs/statuses/4a026afd461fc5168bc9c42ea791c30d409059df"}}}}