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 default Charset for decoding.
      HostsFileEntriesProvider 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.
      HostsFileEntriesProvider parse​(java.io.Reader reader)
      Performs the parsing operation using the provided reader of hosts file format.
      HostsFileEntriesProvider 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.
      HostsFileEntriesProvider parseSilently()
      Parses the hosts file at standard OS location using the system default Charset for decoding.
      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.
      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.
    • Method Detail

      • 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​(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