public class KnownHostEntry extends HostPatternsHolder
known_hosts
fileModifier and Type | Field and Description |
---|---|
static char |
MARKER_INDICATOR
Character that denotes that start of a marker
|
static String |
STD_HOSTS_FILENAME
Standard OpenSSH config file name
|
ALL_HOSTS_PATTERN, NEGATION_CHAR_PATTERN, NON_STANDARD_PORT_PATTERN_ENCLOSURE_END_DELIM, NON_STANDARD_PORT_PATTERN_ENCLOSURE_START_DELIM, PATTERN_CHARS, PORT_VALUE_DELIMITER, SINGLE_CHAR_PATTERN, WILDCARD_PATTERN
Constructor and Description |
---|
KnownHostEntry() |
KnownHostEntry(String line) |
findMatchingEntries, findMatchingEntries, getPatterns, isHostMatch, isHostMatch, isPortMatch, isSpecificHostPattern, isValidPatternChar, parsePatterns, parsePatterns, setPatterns, toPattern
public static final char MARKER_INDICATOR
public static final String STD_HOSTS_FILENAME
public KnownHostEntry()
public KnownHostEntry(String line)
line
- The original line from which this entry was createdpublic String getConfigLine()
public void setConfigLine(String line)
public String getMarker()
public void setMarker(String marker)
public AuthorizedKeyEntry getKeyEntry()
public void setKeyEntry(AuthorizedKeyEntry keyEntry)
public KnownHostHashValue getHashedEntry()
public void setHashedEntry(KnownHostHashValue hashedEntry)
public boolean isHostMatch(String host, int port)
HostPatternsHolder
isHostMatch
in class HostPatternsHolder
host
- The host name / address - ignored if null
/emptyport
- The connection porttrue
if the name / address matches the pattern(s)HostPatternsHolder.isHostMatch(String, Pattern)
public static Path getDefaultKnownHostsFile()
Path
location of the OpenSSH known hosts filepublic static List<KnownHostEntry> readKnownHostEntries(Path path, OpenOption... options) throws IOException
IOException
public static List<KnownHostEntry> readKnownHostEntries(URL url) throws IOException
IOException
public static List<KnownHostEntry> readKnownHostEntries(InputStream inStream, boolean okToClose) throws IOException
IOException
public static List<KnownHostEntry> readKnownHostEntries(Reader rdr, boolean okToClose) throws IOException
IOException
public static List<KnownHostEntry> readKnownHostEntries(BufferedReader rdr) throws IOException
rdr
- The BufferedReader
to useList
of read KnownHostEntry
-iesIOException
- If failed to parse the read configurationpublic static KnownHostEntry parseKnownHostEntry(String line)
public static <E extends KnownHostEntry> E parseKnownHostEntry(E entry, String data)
Copyright © 2008–2024 The Apache Software Foundation. All rights reserved.