Class FileConfigSource<SECTION extends ConfigureSection,​ORIGINAL,​SELF extends FileConfigSource<SECTION,​ORIGINAL,​SELF>>

    • Field Detail

      • file

        @NotNull
        protected final @NotNull java.io.File file
      • resourcePath

        @Nullable
        protected final @Nullable java.lang.String resourcePath
    • Constructor Detail

      • FileConfigSource

        protected FileConfigSource​(@NotNull
                                   @NotNull ConfigurationHolder<? extends SELF> holder,
                                   long lastUpdateMillis,
                                   @NotNull
                                   @NotNull java.io.File file,
                                   @Nullable
                                   @Nullable java.lang.String resourcePath)
    • Method Detail

      • charset

        public java.nio.charset.Charset charset()
      • copyDefaults

        public boolean copyDefaults()
      • initializeFile

        public void initializeFile()
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • fileInputStream

        protected <R> R fileInputStream​(@NotNull
                                        @NotNull DataFunction<java.io.InputStream,​R> loader)
                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • fileReader

        protected <R> R fileReader​(@NotNull
                                   @NotNull DataFunction<java.io.Reader,​R> loader)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • fileReadString

        protected <R> R fileReadString​(@NotNull
                                       @NotNull DataFunction<java.lang.String,​R> loader)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • fileReadString

        protected void fileReadString​(@NotNull
                                      @NotNull DataConsumer<java.lang.String> loader)
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • fileOutputStream

        protected void fileOutputStream​(@NotNull
                                        @NotNull DataConsumer<java.io.OutputStream> stream)
                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • fileWriter

        protected void fileWriter​(@NotNull
                                  @NotNull DataConsumer<java.io.Writer> writer)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • saveResource

        protected void saveResource​(@NotNull
                                    @NotNull java.lang.String resourcePath,
                                    boolean replace)
                             throws java.io.IOException,
                                    java.lang.IllegalArgumentException
        Throws:
        java.io.IOException
        java.lang.IllegalArgumentException
      • getResource

        @Nullable
        protected @Nullable java.io.InputStream getResource​(@NotNull
                                                            @NotNull java.lang.String filename)