/** * Parse hosts file at standard OS location using the system default {@link Charset} for decoding. * * @return a {@link HostsFileEntries} * @throws IOException file could not be read */ public static HostsFileEntries parse() throws IOException { return parse(locateHostsFile()); }
/** * Parse hosts file at standard OS location using the system default {@link Charset} for decoding. * * @return a {@link HostsFileEntries} * @throws IOException file could not be read */ public static HostsFileEntries parse() throws IOException { return parse(locateHostsFile()); }
/** * Parse hosts file at standard OS location. * * @return a {@link HostsFileEntries} * @throws IOException file could not be read */ public static HostsFileEntries parse() throws IOException { return parse(locateHostsFile()); }
/** * Parse hosts file at standard OS location using the given {@link Charset}s one after each other until * we were able to parse something or none is left. * * @param charsets the {@link Charset}s to try as file encodings when parsing. * @return a {@link HostsFileEntries} */ public static HostsFileEntries parseSilently(Charset... charsets) { File hostsFile = locateHostsFile(); try { return parse(hostsFile, charsets); } catch (IOException e) { if (logger.isWarnEnabled()) { logger.warn("Failed to load and parse hosts file at " + hostsFile.getPath(), e); } return HostsFileEntries.EMPTY; } }
/** * Parse hosts file at standard OS location using the given {@link Charset}s one after each other until * we were able to parse something or none is left. * * @param charsets the {@link Charset}s to try as file encodings when parsing. * @return a {@link HostsFileEntries} */ public static HostsFileEntries parseSilently(Charset... charsets) { File hostsFile = locateHostsFile(); try { return parse(hostsFile, charsets); } catch (IOException e) { if (logger.isWarnEnabled()) { logger.warn("Failed to load and parse hosts file at " + hostsFile.getPath(), e); } return HostsFileEntries.EMPTY; } }
/** * Parse hosts file at standard OS location. * * @return a {@link HostsFileEntries} */ public static HostsFileEntries parseSilently() { File hostsFile = locateHostsFile(); try { return parse(hostsFile); } catch (IOException e) { if (logger.isWarnEnabled()) { logger.warn("Failed to load and parse hosts file at " + hostsFile.getPath(), e); } return HostsFileEntries.EMPTY; } }
/** * Parse hosts file at standard OS location. * * @return a {@link HostsFileEntries} * @throws IOException file could not be read */ public static HostsFileEntries parse() throws IOException { return parse(locateHostsFile()); }
/** * Parse hosts file at standard OS location. * * @return a {@link HostsFileEntries} * @throws IOException file could not be read */ public static HostsFileEntries parse() throws IOException { return parse(locateHostsFile()); }
/** * Parse hosts file at standard OS location. * * @return a map of hostname or alias to {@link InetAddress} * @throws IOException file could not be read */ public static Map<String, InetAddress> parse() throws IOException { return parse(locateHostsFile()); }
/** * Parse hosts file at standard OS location using the system default {@link Charset} for decoding. * * @return a {@link HostsFileEntries} * @throws IOException file could not be read */ public static HostsFileEntries parse() throws IOException { return parse(locateHostsFile()); }
/** * Parse hosts file at standard OS location. * * @return a {@link HostsFileEntries} * @throws IOException file could not be read */ public static HostsFileEntries parse() throws IOException { return parse(locateHostsFile()); }
/** * Parse hosts file at standard OS location. * * @return a map of hostname or alias to {@link InetAddress} */ public static Map<String, InetAddress> parseSilently() { File hostsFile = locateHostsFile(); try { return parse(hostsFile); } catch (IOException e) { logger.warn("Failed to load and parse hosts file at " + hostsFile.getPath(), e); return Collections.emptyMap(); } }
/** * Parse hosts file at standard OS location. * * @return a {@link HostsFileEntries} */ public static HostsFileEntries parseSilently() { File hostsFile = locateHostsFile(); try { return parse(hostsFile); } catch (IOException e) { logger.warn("Failed to load and parse hosts file at " + hostsFile.getPath(), e); return HostsFileEntries.EMPTY; } }
/** * Parse hosts file at standard OS location. * * @return a {@link HostsFileEntries} */ public static HostsFileEntries parseSilently() { File hostsFile = locateHostsFile(); try { return parse(hostsFile); } catch (IOException e) { logger.warn("Failed to load and parse hosts file at " + hostsFile.getPath(), e); return HostsFileEntries.EMPTY; } }
/** * Parse hosts file at standard OS location. * * @return a {@link HostsFileEntries} */ public static HostsFileEntries parseSilently() { File hostsFile = locateHostsFile(); try { return parse(hostsFile); } catch (IOException e) { if (logger.isWarnEnabled()) { logger.warn("Failed to load and parse hosts file at " + hostsFile.getPath(), e); } return HostsFileEntries.EMPTY; } }
/** * Parse hosts file at standard OS location using the given {@link Charset}s one after each other until * we were able to parse something or none is left. * * @param charsets the {@link Charset}s to try as file encodings when parsing. * @return a {@link HostsFileEntries} */ public static HostsFileEntries parseSilently(Charset... charsets) { File hostsFile = locateHostsFile(); try { return parse(hostsFile, charsets); } catch (IOException e) { if (logger.isWarnEnabled()) { logger.warn("Failed to load and parse hosts file at " + hostsFile.getPath(), e); } return HostsFileEntries.EMPTY; } }