@UnstableApi public final class HostsFileParser extends Object
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
Charset s one after each other until
we were able to parse something or none is left. |
public static HostsFileEntries parseSilently()
Charset
for decoding.HostsFileEntries
public static HostsFileEntries parseSilently(Charset... charsets)
Charset
s one after each other until
we were able to parse something or none is left.charsets
- the Charset
s to try as file encodings when parsing.HostsFileEntries
public static HostsFileEntries parse() throws IOException
Charset
for decoding.HostsFileEntries
IOException
- file could not be readpublic static HostsFileEntries parse(File file) throws IOException
Charset
for decoding.file
- the file to be parsedHostsFileEntries
IOException
- file could not be readpublic static HostsFileEntries parse(File file, Charset... charsets) throws IOException
file
- the file to be parsedcharsets
- the Charset
s to try as file encodings when parsing.HostsFileEntries
IOException
- file could not be readpublic static HostsFileEntries parse(Reader reader) throws IOException
reader
- the file to be parsedHostsFileEntries
IOException
- file could not be readCopyright © 2008–2019 The Netty Project. All rights reserved.