|
|
|
|
|
|
|
|
throws IOException { |
|
|
throws IOException { |
|
|
KnownHostEntry hostEntry = entry.getHostEntry(); |
|
|
KnownHostEntry hostEntry = entry.getHostEntry(); |
|
|
String oldLine = hostEntry.getConfigLine(); |
|
|
String oldLine = hostEntry.getConfigLine(); |
|
|
|
|
|
if (oldLine == null) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
String newLine = updateHostKeyLine(oldLine, serverKey); |
|
|
String newLine = updateHostKeyLine(oldLine, serverKey); |
|
|
if (newLine == null || newLine.isEmpty()) { |
|
|
if (newLine == null || newLine.isEmpty()) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
if (oldLine == null || oldLine.isEmpty() || newLine.equals(oldLine)) { |
|
|
|
|
|
|
|
|
if (oldLine.isEmpty() || newLine.equals(oldLine)) { |
|
|
// Shouldn't happen. |
|
|
// Shouldn't happen. |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |