public final class HostsFileParser extends Object
HostsFileEntriesProvider when mappings with all entries per hostname are needed.| Modifier and Type | Method and Description |
|---|---|
static HostsFileEntries |
parse()
Parse hosts file at standard OS location using the system default
Charset for decoding. |
static HostsFileEntries |
parse(File file)
Parse a hosts file using the system default
Charset for decoding. |
static HostsFileEntries |
parse(File file,
Charset... charsets)
Parse a hosts file.
|
static HostsFileEntries |
parse(Reader reader)
Parse a reader of hosts file format.
|
static HostsFileEntries |
parseSilently()
Parse hosts file at standard OS location using the systems default
Charset for decoding. |
static HostsFileEntries |
parseSilently(Charset... charsets)
Parse hosts file at standard OS location using the given
Charsets one after each other until
we were able to parse something or none is left. |
public static HostsFileEntries parseSilently()
Charset for decoding.HostsFileEntriespublic static HostsFileEntries parseSilently(Charset... charsets)
Charsets one after each other until
we were able to parse something or none is left.charsets - the Charsets to try as file encodings when parsing.HostsFileEntriespublic static HostsFileEntries parse() throws IOException
Charset for decoding.HostsFileEntriesIOException - file could not be readpublic static HostsFileEntries parse(File file) throws IOException
Charset for decoding.file - the file to be parsedHostsFileEntriesIOException - file could not be readpublic static HostsFileEntries parse(File file, Charset... charsets) throws IOException
file - the file to be parsedcharsets - the Charsets to try as file encodings when parsing.HostsFileEntriesIOException - file could not be readpublic static HostsFileEntries parse(Reader reader) throws IOException
reader - the file to be parsedHostsFileEntriesIOException - file could not be readCopyright © 2008–2025 The Netty Project. All rights reserved.