@UnstableApi public final class HostsFileParser extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static InternalLogger |
logger |
private static java.util.regex.Pattern |
WHITESPACES |
private static java.lang.String |
WINDOWS_DEFAULT_SYSTEM_ROOT |
private static java.lang.String |
WINDOWS_HOSTS_FILE_RELATIVE_PATH |
private static java.lang.String |
X_PLATFORMS_HOSTS_FILE_PATH |
Modifier | Constructor and Description |
---|---|
private |
HostsFileParser()
Can't be instantiated.
|
Modifier and Type | Method and Description |
---|---|
private static java.io.File |
locateHostsFile() |
static HostsFileEntries |
parse()
Parse hosts file at standard OS location.
|
static HostsFileEntries |
parse(java.io.File file)
Parse a hosts file.
|
static HostsFileEntries |
parse(java.io.Reader reader)
Parse a reader of hosts file format.
|
static HostsFileEntries |
parseSilently()
Parse hosts file at standard OS location.
|
private static final java.lang.String WINDOWS_DEFAULT_SYSTEM_ROOT
private static final java.lang.String WINDOWS_HOSTS_FILE_RELATIVE_PATH
private static final java.lang.String X_PLATFORMS_HOSTS_FILE_PATH
private static final java.util.regex.Pattern WHITESPACES
private static final InternalLogger logger
private static java.io.File locateHostsFile()
public static HostsFileEntries parseSilently()
HostsFileEntries
public static HostsFileEntries parse() throws java.io.IOException
HostsFileEntries
java.io.IOException
- file could not be readpublic static HostsFileEntries parse(java.io.File file) throws java.io.IOException
file
- the file to be parsedHostsFileEntries
java.io.IOException
- file could not be readpublic static HostsFileEntries parse(java.io.Reader reader) throws java.io.IOException
reader
- the file to be parsedHostsFileEntries
java.io.IOException
- file could not be read