Code example for PrintWriter

Methods: close

0
			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)
			{ 
				pw.close();
			} 
		} 
 
	}