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