Interface HostsFileEntriesProvider.Parser

All Known Implementing Classes:
HostsFileEntriesProvider.ParserImpl
Enclosing class:
HostsFileEntriesProvider

public static interface HostsFileEntriesProvider.Parser
  • Method Summary

    Modifier and Type
    Method
    Description
    Parses the hosts file at standard OS location using the system default Charset for decoding.
    parse(java.io.File file, java.nio.charset.Charset... charsets)
    Parses the provided hosts file using the given Charsets one after another until parse something or none is left.
    parse(java.io.Reader reader)
    Performs the parsing operation using the provided reader of hosts file format.
    parse(java.nio.charset.Charset... charsets)
    Parses the hosts file at standard OS location using the given Charsets one after another until parse something or none is left.
    Parses the hosts file at standard OS location using the system default Charset for decoding.
    parseSilently(java.io.File file, java.nio.charset.Charset... charsets)
    Parses the provided hosts file using the given Charsets one after another until parse something or none is left.
    parseSilently(java.nio.charset.Charset... charsets)
    Parses the hosts file at standard OS location using the given Charsets one after another until parse something or none is left.
  • Method Details

    • parse

      HostsFileEntriesProvider parse() throws java.io.IOException
      Parses the hosts file at standard OS location using the system default Charset for decoding.
      Returns:
      a new HostsFileEntriesProvider
      Throws:
      java.io.IOException - file could not be read
    • parse

      HostsFileEntriesProvider parse(java.nio.charset.Charset... charsets) throws java.io.IOException
      Parses the hosts file at standard OS location using the given Charsets one after another until parse something or none is left.
      Parameters:
      charsets - the Charsets to try as file encodings when parsing
      Returns:
      a new HostsFileEntriesProvider
      Throws:
      java.io.IOException - file could not be read
    • parse

      HostsFileEntriesProvider parse(java.io.File file, java.nio.charset.Charset... charsets) throws java.io.IOException
      Parses the provided hosts file using the given Charsets one after another until parse something or none is left. In case Charsets are not provided, the system default Charset is used for decoding.
      Parameters:
      file - the file to be parsed
      charsets - the Charsets to try as file encodings when parsing, in case Charsets are not provided, the system default Charset is used for decoding
      Returns:
      a new HostsFileEntriesProvider
      Throws:
      java.io.IOException - file could not be read
    • parse

      HostsFileEntriesProvider parse(java.io.Reader reader) throws java.io.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:
      java.io.IOException
    • parseSilently

      HostsFileEntriesProvider parseSilently()
      Parses the hosts file at standard OS location using the system default Charset for decoding.
      Returns:
      a new HostsFileEntriesProvider
    • parseSilently

      HostsFileEntriesProvider parseSilently(java.nio.charset.Charset... charsets)
      Parses the hosts file at standard OS location using the given Charsets one after another until parse something or none is left.
      Parameters:
      charsets - the Charsets to try as file encodings when parsing
      Returns:
      a new HostsFileEntriesProvider
    • parseSilently

      HostsFileEntriesProvider parseSilently(java.io.File file, java.nio.charset.Charset... charsets)
      Parses the provided hosts file using the given Charsets one after another until parse something or none is left. In case Charsets are not provided, the system default Charset is used for decoding.
      Parameters:
      file - the file to be parsed
      charsets - the Charsets to try as file encodings when parsing, in case Charsets are not provided, the system default Charset is used for decoding
      Returns:
      a new HostsFileEntriesProvider