Had to change System.getProperty("line.separator") to "\n". Thats what caused indentation problems.