public void exportSolution() {

		int steps = model.getMoves().size();
		File file = new File(basePath + player + "/" + FOLDER_SOLUTIONS + "/"
				+ levelName + ".sol");

		// Create the file, if it doesn't already exist
		try {
			if (file.createNewFile()) {
				try {
					FileWriter fw = new FileWriter(file);
					fw.write("9999999:dummy");
					fw.close();
				} catch (Exception ex2) {
					ex2.printStackTrace();
				}
			}
		} catch (Exception ex) {
		}

		String fileContent = new String();
		try {
			fileContent = new String(Files.readAllBytes(Paths.get(file
					.toString())));
		} catch (IOException ex) {
			ex.printStackTrace();
		}
		System.out.println(fileContent);
		String[] content = fileContent.split(":");

		// Check if the current solution is better than the existing.
		if (Integer.parseInt(content[0]) > steps) {
			String playerPath = view.board.getPlayerPath();
			String newFileContent = steps + ":" + playerPath;

			try {
				FileWriter fw = new FileWriter(file);
				fw.write(newFileContent);
				fw.close();
			} catch (Exception ex) {
				ex.printStackTrace();
			}
		}
	}