-
- Enclosing class:
- HostsFileEntriesProvider
public static interface HostsFileEntriesProvider.Parser
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description HostsFileEntriesProviderparse()Parses the hosts file at standard OS location using the system defaultCharsetfor decoding.HostsFileEntriesProviderparse(File file, Charset... charsets)Parses the provided hosts file using the givenCharsets one after another until parse something or none is left.HostsFileEntriesProviderparse(Reader reader)Performs the parsing operation using the provided reader of hosts file format.HostsFileEntriesProviderparse(Charset... charsets)Parses the hosts file at standard OS location using the givenCharsets one after another until parse something or none is left.HostsFileEntriesProviderparseSilently()Parses the hosts file at standard OS location using the system defaultCharsetfor decoding.HostsFileEntriesProviderparseSilently(File file, Charset... charsets)Parses the provided hosts file using the givenCharsets one after another until parse something or none is left.HostsFileEntriesProviderparseSilently(Charset... charsets)Parses the hosts file at standard OS location using the givenCharsets one after another until parse something or none is left.
-
-
-
Method Detail
-
parse
HostsFileEntriesProvider parse() throws IOException
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
HostsFileEntriesProvider parse(Charset... charsets) throws IOException
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
HostsFileEntriesProvider parse(File file, Charset... charsets) throws IOException
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
HostsFileEntriesProvider parse(Reader reader) throws IOException
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
HostsFileEntriesProvider parseSilently(Charset... charsets)
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
HostsFileEntriesProvider parseSilently(File file, Charset... charsets)
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
-
-