Package io.netty.resolver
Interface HostsFileEntriesProvider.Parser
- All Known Implementing Classes:
HostsFileEntriesProvider.ParserImpl
- Enclosing class:
HostsFileEntriesProvider
public static interface HostsFileEntriesProvider.Parser
-
Method Summary
Modifier and TypeMethodDescriptionparse()
Parses the hosts file at standard OS location using the system defaultCharset
for decoding.Parses the provided hosts file using the givenCharset
s one after another until parse something or none is left.Performs the parsing operation using the provided reader of hosts file format.Parses the hosts file at standard OS location using the givenCharset
s one after another until parse something or none is left.Parses the hosts file at standard OS location using the system defaultCharset
for decoding.parseSilently
(File file, Charset... charsets) Parses the provided hosts file using the givenCharset
s one after another until parse something or none is left.parseSilently
(Charset... charsets) Parses the hosts file at standard OS location using the givenCharset
s one after another until parse something or none is left.
-
Method Details
-
parse
Parses the hosts file at standard OS location using the system defaultCharset
for decoding.- Returns:
- a new
HostsFileEntriesProvider
- Throws:
IOException
- file could not be read
-
parse
Parses the hosts file at standard OS location using the givenCharset
s one after another until parse something or none is left.- Parameters:
charsets
- theCharset
s to try as file encodings when parsing- Returns:
- a new
HostsFileEntriesProvider
- Throws:
IOException
- file could not be read
-
parse
Parses the provided hosts file using the givenCharset
s one after another until parse something or none is left. In caseCharset
s are not provided, the system defaultCharset
is used for decoding.- Parameters:
file
- the file to be parsedcharsets
- theCharset
s to try as file encodings when parsing, in caseCharset
s are not provided, the system defaultCharset
is used for decoding- Returns:
- a new
HostsFileEntriesProvider
- Throws:
IOException
- file could not be read
-
parse
Performs the parsing operation using the provided reader of hosts file format.- Parameters:
reader
- the reader of hosts file format- Returns:
- a new
HostsFileEntriesProvider
- Throws:
IOException
-
parseSilently
HostsFileEntriesProvider parseSilently()Parses the hosts file at standard OS location using the system defaultCharset
for decoding.- Returns:
- a new
HostsFileEntriesProvider
-
parseSilently
Parses the hosts file at standard OS location using the givenCharset
s one after another until parse something or none is left.- Parameters:
charsets
- theCharset
s to try as file encodings when parsing- Returns:
- a new
HostsFileEntriesProvider
-
parseSilently
Parses the provided hosts file using the givenCharset
s one after another until parse something or none is left. In caseCharset
s are not provided, the system defaultCharset
is used for decoding.- Parameters:
file
- the file to be parsedcharsets
- theCharset
s to try as file encodings when parsing, in caseCharset
s are not provided, the system defaultCharset
is used for decoding- Returns:
- a new
HostsFileEntriesProvider
-