Fix chatfile - shouldn't have changed this with last fix
This commit is contained in:
parent
6485ac10cc
commit
440b33dff4
1 changed files with 1 additions and 4 deletions
|
|
@ -127,15 +127,12 @@ public class JsonFileClientUpdateComponent extends ClientUpdateComponent {
|
||||||
|
|
||||||
protected void handleWebChat() {
|
protected void handleWebChat() {
|
||||||
File webchatFile = getStandaloneFile("dynmap_webchat.json");
|
File webchatFile = getStandaloneFile("dynmap_webchat.json");
|
||||||
File webchatTempFile = getStandaloneFile("dynmap_webchat.json.new");
|
|
||||||
if (webchatFile.exists() && lastTimestamp != 0) {
|
if (webchatFile.exists() && lastTimestamp != 0) {
|
||||||
JSONArray jsonMsgs = null;
|
JSONArray jsonMsgs = null;
|
||||||
try {
|
try {
|
||||||
FileReader inputFileReader = new FileReader(webchatTempFile);
|
FileReader inputFileReader = new FileReader(webchatFile);
|
||||||
jsonMsgs = (JSONArray) parser.parse(inputFileReader);
|
jsonMsgs = (JSONArray) parser.parse(inputFileReader);
|
||||||
inputFileReader.close();
|
inputFileReader.close();
|
||||||
webchatFile.delete();
|
|
||||||
webchatTempFile.renameTo(webchatFile);
|
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Log.severe("Exception while reading JSON-file.", ex);
|
Log.severe("Exception while reading JSON-file.", ex);
|
||||||
} catch (ParseException ex) {
|
} catch (ParseException ex) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue