Class FileConfig

    • Method Detail

      • readToMap

        protected abstract Map<String,​?> readToMap()
                                                  throws IOException
        Loads value to map from file.
        Returns:
        Loaded values map.
        Throws:
        IOException - Thrown when error when reading file.
      • writeToString

        protected abstract String writeToString()
        Writes this config to string to save in file.
        Returns:
        New string.
      • reload

        public void reload()
        Reads data from file and loads it to memory.
      • save

        public void save()
        Writes data in memory to string and saves it to file.
      • reloadIfNeeded

        protected void reloadIfNeeded()
      • getPath

        @NotNull
        public @NotNull Path getPath()
        Gets the configuration file.
        Returns:
        The configuration file.