Added plugin saveResources + saveDefaultConfig methods. This completes a bleeding branch by deltahat at http://forums.bukkit.org/threads/branch-complete-savedefaultconfig.48721/

By: Nathan Adams <dinnerbone@dinnerbone.com>
This commit is contained in:
Bukkit/Spigot
2011-12-22 21:18:36 +00:00
parent 7540ab7e68
commit 98960fd73e
2 changed files with 65 additions and 3 deletions

View File

@@ -58,6 +58,23 @@ public interface Plugin extends CommandExecutor {
* Saves the {@link FileConfiguration} retrievable by {@link #getConfig()}.
*/
public void saveConfig();
/**
* Saves the raw contents of the default config.yml file to the location retrievable by {@link #getConfig()}.
* If there is no default config.yml embedded in the plugin, an empty config.yml file is saved.
*/
public void saveDefaultConfig();
/**
* Saves the raw contents of any resource embedded with a plugin's .jar file assuming it can be found using
* {@link #getResource(String)}. The resource is saved into the plugin's data folder using the same hierarchy
* as the .jar file (subdirectories are preserved).
*
* @param resourcePath the embedded resource path to look for within the plugin's .jar file. (No preceding slash).
* @param replace if true, the embedded resource will overwrite the contents of an existing file.
* @throws IllegalArgumentException if the resource path is null, empty, or points to a nonexistent resource.
*/
public void saveResource(String resourcePath, boolean replace);
/**
* Discards any data in {@link #getConfig()} and reloads from disk.