Skip to content

Instantly share code, notes, and snippets.

@ScRaizer
Created April 8, 2015 23:30
Show Gist options
  • Save ScRaizer/0cb1a73d1aec483bc789 to your computer and use it in GitHub Desktop.
Save ScRaizer/0cb1a73d1aec483bc789 to your computer and use it in GitHub Desktop.
Creating a new file
FileConfiguration data = null;
try {
data = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "data.yml").exists() ? (new File(getDataFolder(), "data.yml").createNewFile() ? new File(getDataFolder(), "data.yml") : null ) : new File(getDataFolder(), "data.yml"));
} catch (IOException ignored) {}
getLogger().log(data == null ? Level.SEVERE : Level.INFO, "[FILES]" + (data == null ? "Unable to create data file" : "Data file created sucessfully!"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment