Interface HostsFileEntriesProvider.Parser
- Enclosing class:
HostsFileEntriesProvider
public static interface HostsFileEntriesProvider.Parser
-
Method Summary
Modifier and TypeMethodDescriptionparse()Parses the hosts file at standard OS location using the system defaultCharsetfor decoding.Parses the provided hosts file using the givenCharsets 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 givenCharsets one after another until parse something or none is left.Parses the hosts file at standard OS location using the system defaultCharsetfor decoding.parseSilently(File file, Charset... charsets) Parses the provided hosts file using the givenCharsets one after another until parse something or none is left.parseSilently(Charset... charsets) Parses the hosts file at standard OS location using the givenCharsets one after another until parse something or none is left.
-
Method Details
-
parse
Parses the hosts file at standard OS location using the system defaultCharsetfor decoding.- Returns:
- a new
HostsFileEntriesProvider - Throws:
IOException- file could not be read
-
parse
Parses the hosts file at standard OS location using the givenCharsets one after another until parse something or none is left.- Parameters:
charsets- theCharsets 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 givenCharsets one after another until parse something or none is left. In caseCharsets are not provided, the system defaultCharsetis used for decoding.- Parameters:
file- the file to be parsedcharsets- theCharsets to try as file encodings when parsing, in caseCharsets are not provided, the system defaultCharsetis 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 defaultCharsetfor decoding.- Returns:
- a new
HostsFileEntriesProvider
-
parseSilently
Parses the hosts file at standard OS location using the givenCharsets one after another until parse something or none is left.- Parameters:
charsets- theCharsets to try as file encodings when parsing- Returns:
- a new
HostsFileEntriesProvider
-
parseSilently
Parses the provided hosts file using the givenCharsets one after another until parse something or none is left. In caseCharsets are not provided, the system defaultCharsetis used for decoding.- Parameters:
file- the file to be parsedcharsets- theCharsets to try as file encodings when parsing, in caseCharsets are not provided, the system defaultCharsetis used for decoding- Returns:
- a new
HostsFileEntriesProvider
-