Code example for File

Methods: exists, getParentFile, mkdirs

0
PrintWriter pw = null;
		try 
		{ 
			final StorageObject object = getObject();
			final File folder = file.getParentFile();
			if (!folder.exists())
			{ 
				folder.mkdirs();
			} 
			pw = new PrintWriter(file);
			new YamlStorageWriter(pw).save(object);
		} 
		catch (FileNotFoundException ex)
		{ 
			Bukkit.getLogger().log(Level.SEVERE, file.toString(), ex);
		} 
		finally 
		{ 
			onFinish(); 
			if (pw != null)