private void initialize(File knownHosts) throws IOException { char[] buff = new char[512]; CharArrayWriter cw = new CharArrayWriter(); knownHosts.createNewFile(); FileReader fr = new FileReader(knownHosts); while (true) { int len = fr.read(buff); if (len < 0) break; cw.write(buff, 0, len); } fr.close(); initialize(cw.toCharArray()); }
public KnownHosts(File knownHosts) throws IOException { initialize(knownHosts); }
public KnownHosts(char[] knownHostsData) throws IOException { initialize(knownHostsData); }
/** * Parses the given known_hosts file and adds entries to the database. * * @param knownHosts * @throws IOException */ public void addHostkeys(File knownHosts) throws IOException { initialize(knownHosts); }
/** * Parses the given known_hosts data and adds entries to the database. * * @param knownHostsData * @throws IOException */ public void addHostkeys(char[] knownHostsData) throws IOException { initialize(knownHostsData); }