Class Krb5Parser

java.lang.Object
org.apache.kerby.kerberos.kerb.common.Krb5Parser

public class Krb5Parser extends Object
A parser to parse krb5.conf format file.
  • Constructor Details

    • Krb5Parser

      public Krb5Parser(File confFile)
  • Method Details

    • load

      public void load() throws IOException
      Load the krb5.conf into a member variable, which is a Map.
      Throws:
      IOException - e
    • getItems

      public Map<String,Object> getItems()
      Get the whole map.
      Returns:
      member variable items.
    • getSections

      public List<String> getSections()
      Get all the names of sections in a list.
      Returns:
      a list of section names.
    • getSection

      public Object getSection(String sectionName, String... keys)
      Get the contents of a section given the section name.
      Parameters:
      sectionName - the name of a section
      keys - the keys list
      Returns:
      a Map of section contents
    • dump

      public void dump()
      Print all the meaningful contents of the krb5.conf on the console. Comments are ignored. Hierarchy is considered. Attention that the order of sections and the order inside a section will be different to the original file, due to the use of HashMap.