Module tvbrowser
Package util.io

Class IniFileReader


  • public class IniFileReader
    extends java.lang.Object
    This class reads Ini-Files. Ini-Files are Property-Files with [sections] and Key=Value Text Each [Section] is loaded into an unique HashMap.
    • Constructor Summary

      Constructors 
      Constructor Description
      IniFileReader​(java.io.File iniFile)
      Loads the Ini-File
      IniFileReader​(java.io.InputStream stream)
      Loads the Ini from a InputStream
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String[] getAllSections()
      Gets all available Sections in the loaded Ini-File
      java.util.HashMap<java.lang.String,​java.lang.String> getSection​(java.lang.String section)
      Get a specific "Section" of the Ini-File.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IniFileReader

        public IniFileReader​(java.io.File iniFile)
                      throws java.io.IOException
        Loads the Ini-File
        Parameters:
        iniFile - File to load
        Throws:
        java.io.IOException - Thrown if an IO operation went wrong.
      • IniFileReader

        public IniFileReader​(java.io.InputStream stream)
                      throws java.io.IOException
        Loads the Ini from a InputStream
        Parameters:
        stream - Stream with Ini-File
        Throws:
        java.io.IOException - Thrown if an IO operation went wrong.
    • Method Detail

      • getSection

        public java.util.HashMap<java.lang.String,​java.lang.String> getSection​(java.lang.String section)
        Get a specific "Section" of the Ini-File. Each Key=Value is stored in the HashMap as Key = Value
        Parameters:
        section - Section to return
        Returns:
        Specific Section as HashMap
      • getAllSections

        public java.lang.String[] getAllSections()
        Gets all available Sections in the loaded Ini-File
        Returns:
        array of sections