Class Banner

java.lang.Object
com.bobocode.bring.core.utils.Banner

public class Banner extends Object
The Banner class provides functionality for printing a banner to the console, either from a predefined string or custom banner by reading from a file.

Configuration options:

  • BRING_BANNER_KEY: Key for enabling/disabling the main banner. Default is "ON".
  • BRING_BANNER_FILE_KEY: Key for specifying the path to the banner file. Default is "resource/banner.txt".
See Also:
  • Field Details

    • BRING_BANNER_KEY

      public static final String BRING_BANNER_KEY
      Key for enabling/disabling the main banner. Default is "ON".
      See Also:
    • BRING_BANNER_VALUE

      public static final String BRING_BANNER_VALUE
      Default value for enabling/disabling the main banner.
      See Also:
    • BRING_BANNER_FILE_KEY

      public static final String BRING_BANNER_FILE_KEY
      Key for specifying the path to the banner file. Default is "resources/banner.txt".
      See Also:
    • BRING_BANNER_FILE_VALUE

      public static final String BRING_BANNER_FILE_VALUE
      Default value for specifying the path to the banner file.
      See Also:
    • FILE_NOT_FOUND_MESSAGE

      private static final String FILE_NOT_FOUND_MESSAGE
      Message displayed when the resource folder is not found.
      See Also:
    • DEFAULT_BANNER_CONTENT

      public static final String DEFAULT_BANNER_CONTENT
      The default banner content.
      See Also:
  • Constructor Details

    • Banner

      public Banner()
  • Method Details

    • printBanner

      public static void printBanner()
      Prints the banner to the console based on the configured mode and file settings.
    • getBannerMode

      private static Banner.Mode getBannerMode()
      Gets the configured banner mode (ON or OFF).
      Returns:
      The configured banner mode.
    • hasToReadFromFile

      private static boolean hasToReadFromFile()
      Checks if the banner should be read from a file based on the configuration.
      Returns:
      true if reading from a file is configured, false otherwise.
    • getPath

      private static Path getPath()
      Gets the path to the banner file, resolving it based on the classpath.
      Returns:
      The path to the banner file.