This reader is a bit more robust and tries to handle this case if there is only one colon (otherwise it might be an IPv6 address (without port)), and it skips and logs invalid entries, but still returns all other valid entries from the file.
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static String | |
| pack-priv static KnownHostEntry | |
| private static Collection | |
| public static List | Returns: aList of all valid entries read from the fileof the file to read path)Reads a known_hosts file and returns all valid entries. |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| KnownHostEntryReader | back to summary |
|---|---|
| private KnownHostEntryReader() | |
| clean | back to summary |
|---|---|
| private static String clean(String line) | |
| parseHostEntry | back to summary |
|---|---|
| pack-priv static KnownHostEntry parseHostEntry(String line) | |
| parsePatterns | back to summary |
|---|---|
| private static Collection | |
| readFromFile | back to summary |
|---|---|
| public static List Reads a known_hosts file and returns all valid entries. Invalid entries are skipped (and a message is logged).
| |