Class AudioStreamUtils

java.lang.Object
org.openhab.core.audio.utils.AudioStreamUtils

@NonNullByDefault public class AudioStreamUtils extends Object
Some general filename and extension utilities.
Author:
Christoph Weitkamp - Initial contribution
  • Field Details

  • Constructor Details

    • AudioStreamUtils

      public AudioStreamUtils()
  • Method Details

    • getBaseName

      public static String getBaseName(String filename)
      Gets the base name of a filename.
      Parameters:
      filename - the filename to query
      Returns:
      the base name of the file or an empty string if none exists or null if the filename is null
    • getExtension

      public static String getExtension(String filename)
      Gets the extension of a filename.
      Parameters:
      filename - the filename to retrieve the extension of
      Returns:
      the extension of the file or an empty string if none exists or null if the filename is null
    • isExtension

      public static boolean isExtension(String filename, String extension)
      Checks if the extension of a filename matches the given.
      Parameters:
      filename - the filename to check the extension of
      extension - the extension to check for
      Returns:
      true if the filename has the specified extension