I'm trying to get info from a file (it's to be used as a settings file, true or false values), using the following code:
File information = new File(aPath + "/plugins/ArenaCraft/info.acs");
ArrayList<String> info = new ArrayList<String>();
BufferedReader br = new BufferedReader(new FileReader(information));
String line;
while((line = br.readLine()) != null) {
String[] sLine = line.split(":");
if(sLine[1] == "true"){
info.add("true");
}
if(sLine[1] == "false"){
info.add("false");
}
if(sLine[1] == null){
System.err.println("[ArenaCraft] sLine[1] is NULL.");
}
if(sLine[1] != "true" && sLine[1] != "false" && sLine[1] != null){
System.err.println("[ArenaCraft] sLine[1] is not NULL, but it's not \"true\" or \"false\".");
System.err.println("[ArenaCraft] sLine[1] is: " + sLine[1]);
}
}
br.close();
return info;
This, however, is outputting the
[ArenaCraft] sLine[1] is not NULL, but it's not "true" or "false".
message. It then outputs, exactly,
[ArenaCraft] sLine[1] is: true
So, I don't understand why it says it's not null or true or false. Do you guys imagine why that would happen?
The contents of the file I'm trying to read, with no encoding, follow:
notices:true
and nothing more.
Any help would be greatly appreciated, thanks in advance.