File not deleting with if statement even if it is true, but is deleting without if statement
<p>Whenever I add the: </p>

<p><code>if(lines[0].equalsIgnoreCase("owner: " + sender.getName()))</code></p>

<p>The file does not delete, but yet this: </p>

<p><code>System.out.println("Deleted message successfully!");</code></p>

<p>still runs, meaning the if statement is true.</p>

<p>Whenever I delete the if statement above, it does delete the file.</p>

<p>Here is the code: (not the best)</p>

<pre><code>String lines[], strLine;
int a = 0;
String fileLoc = currentDir + "//plugins//ExtendedSigns//" + c[1] + ".txt";
LineNumberReader  lnr = new LineNumberReader(new FileReader(new File(fileLoc)));
FileInputStream in = new FileInputStream(fileLoc);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
lnr.skip(Long.MAX_VALUE);
lines = new String[1 + lnr.getLineNumber()];
while ((strLine = br.readLine()) != null)   
{
    lines[a] = strLine;
    a++;
}
if(lines[0].equalsIgnoreCase("owner: " + sender.getName()))
{
    File del = new File(currentDir + "//plugins//ExtendedSigns//" + c[1] + ".txt");
    del.delete();
    System.out.println("Deleted message successfully!");

}
else
{
    System.out.println("Deleted message unsuccessfully! You do not own it!");
}
</code></pre>
