Package org.openhab.core.audio.utils
Class AudioStreamUtils
java.lang.Object
org.openhab.core.audio.utils.AudioStreamUtils
Some general filename and extension utilities.
- Author:
- Christoph Weitkamp - Initial contribution
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getBaseName
(String filename) Gets the base name of a filename.static String
getExtension
(String filename) Gets the extension of a filename.static boolean
isExtension
(String filename, String extension) Checks if the extension of a filename matches the given.
-
Field Details
-
EXTENSION_SEPARATOR
- See Also:
-
-
Constructor Details
-
AudioStreamUtils
public AudioStreamUtils()
-
-
Method Details
-
getBaseName
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 isnull
-
getExtension
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 isnull
-
isExtension
Checks if the extension of a filename matches the given.- Parameters:
filename
- the filename to check the extension ofextension
- the extension to check for- Returns:
true
if the filename has the specified extension
-