Code example for FileReader

Methods: close

0
	public static Level loadFromPath(String path) throws FileNotFoundException {
		XStream xstream = initXStream();
		FileReader reader;
		 
		try { 
			reader = new FileReader(path);
			 
			Level newLevel = (Level)xstream.fromXML(reader);
			reader.close();
			 
			return newLevel;
		} catch (IOException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} 
		 
		return null; 
	} 
	 
	/////////////////////// 
	// Level modification