Package io.netty.resolver
Class HostsFileEntriesProvider.ParserImpl
java.lang.Object
io.netty.resolver.HostsFileEntriesProvider.ParserImpl
- All Implemented Interfaces:
HostsFileEntriesProvider.Parser
- Enclosing class:
HostsFileEntriesProvider
private static final class HostsFileEntriesProvider.ParserImpl
extends Object
implements HostsFileEntriesProvider.Parser
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final HostsFileEntriesProvider.ParserImpl
private static final InternalLogger
private static final Pattern
private static final String
private static final String
private static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static File
parse()
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.
-
Field Details
-
WINDOWS_DEFAULT_SYSTEM_ROOT
- See Also:
-
WINDOWS_HOSTS_FILE_RELATIVE_PATH
- See Also:
-
X_PLATFORMS_HOSTS_FILE_PATH
- See Also:
-
WHITESPACES
-
logger
-
INSTANCE
-
-
Constructor Details
-
ParserImpl
private ParserImpl()
-
-
Method Details
-
parse
Description copied from interface:HostsFileEntriesProvider.Parser
Parses the hosts file at standard OS location using the system defaultCharset
for decoding.- Specified by:
parse
in interfaceHostsFileEntriesProvider.Parser
- Returns:
- a new
HostsFileEntriesProvider
- Throws:
IOException
- file could not be read
-
parse
Description copied from interface:HostsFileEntriesProvider.Parser
Parses the hosts file at standard OS location using the givenCharset
s one after another until parse something or none is left.- Specified by:
parse
in interfaceHostsFileEntriesProvider.Parser
- Parameters:
charsets
- theCharset
s to try as file encodings when parsing- Returns:
- a new
HostsFileEntriesProvider
- Throws:
IOException
- file could not be read
-
parse
Description copied from interface:HostsFileEntriesProvider.Parser
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.- Specified by:
parse
in interfaceHostsFileEntriesProvider.Parser
- 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
Description copied from interface:HostsFileEntriesProvider.Parser
Performs the parsing operation using the provided reader of hosts file format.- Specified by:
parse
in interfaceHostsFileEntriesProvider.Parser
- Parameters:
reader
- the reader of hosts file format- Returns:
- a new
HostsFileEntriesProvider
- Throws:
IOException
-
parseSilently
Description copied from interface:HostsFileEntriesProvider.Parser
Parses the hosts file at standard OS location using the system defaultCharset
for decoding.- Specified by:
parseSilently
in interfaceHostsFileEntriesProvider.Parser
- Returns:
- a new
HostsFileEntriesProvider
-
parseSilently
Description copied from interface:HostsFileEntriesProvider.Parser
Parses the hosts file at standard OS location using the givenCharset
s one after another until parse something or none is left.- Specified by:
parseSilently
in interfaceHostsFileEntriesProvider.Parser
- Parameters:
charsets
- theCharset
s to try as file encodings when parsing- Returns:
- a new
HostsFileEntriesProvider
-
parseSilently
Description copied from interface:HostsFileEntriesProvider.Parser
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.- Specified by:
parseSilently
in interfaceHostsFileEntriesProvider.Parser
- 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
-
locateHostsFile
-