Class ConfigSource.ResourceConfigSource

java.lang.Object
tech.guilhermekaua.spigotboot.config.loader.ConfigSource.ResourceConfigSource
All Implemented Interfaces:
ConfigSource
Enclosing interface:
ConfigSource

public static class ConfigSource.ResourceConfigSource extends Object implements ConfigSource
Classpath resource configuration source implementation.
  • Method Details

    • openRead

      @NotNull public @NotNull InputStream openRead() throws IOException
      Description copied from interface: ConfigSource
      Opens an input stream to read the configuration.
      Specified by:
      openRead in interface ConfigSource
      Returns:
      the input stream
      Throws:
      IOException - if the stream cannot be opened
    • openWrite

      @NotNull public @NotNull OutputStream openWrite() throws IOException
      Description copied from interface: ConfigSource
      Opens an output stream to write the configuration.
      Specified by:
      openWrite in interface ConfigSource
      Returns:
      the output stream
      Throws:
      IOException - if the stream cannot be opened
    • exists

      public boolean exists()
      Description copied from interface: ConfigSource
      Checks if this source exists.
      Specified by:
      exists in interface ConfigSource
      Returns:
      true if the source exists and can be read
    • name

      @NotNull public @NotNull String name()
      Description copied from interface: ConfigSource
      Gets the name of this source (for display/logging purposes).
      Specified by:
      name in interface ConfigSource
      Returns:
      the source name
    • path

      @Nullable public @Nullable Path path()
      Description copied from interface: ConfigSource
      Gets the file path for file-based sources.
      Specified by:
      path in interface ConfigSource
      Returns:
      the path, or null if not file-based