src/main/java/tsz/game/DAO/GameDataDAO.java
/**
	 * Create a JSON file, if it does not exist.
	 */
Create a JSON file, if it does not exist.
Create a JSON file if it does not exist .
public void createFileIfNotExist() {
		File dataFile = new File(this.pathToDataFile);
		if(!dataFile.exists()) {
			try {
				dataFile.createNewFile();
				PrintWriter printWriter = new PrintWriter(new File(this.pathToDataFile));
				printWriter.write("[]");
				printWriter.close();
				logger.info("JSON file created.");
			} catch (IOException e) {
				logger.error(e.toString());;
			}
		}
	}
public void createFileIfNotExist ( ) { File dataFile = new File ( this . pathToDataFile ) ; if ( ! dataFile . exists ( ) ) { try { dataFile . createNewFile ( ) ; PrintWriter printWriter = new PrintWriter ( new File ( this . pathToDataFile ) ) ; printWriter . write ( "[]" ) ; printWriter . close ( ) ; logger . info ( "JSON file created." ) ; } catch ( IOException e ) { logger . error ( e . toString ( ) ) ; ; } } }
Create a JSON file, if it does not exist.
Create a JSON file if it does not exist .