public class SoundsUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
VALID_SOUND_REGEX |
Modifier and Type | Method and Description |
---|---|
static void |
copySound(java.lang.String oldSoundName,
java.lang.String newSoundName)
Copies the sound file with the given name.
|
static boolean |
deleteSounds(java.lang.String[] soundNames)
Delete the sound files with the given names.
|
static java.lang.String |
fetchSoundFileContent(java.lang.String soundName)
Returns the content of the sound file with the given name.
|
static java.lang.String |
fetchSounds()
Returns the names of existing sound files.
|
static java.lang.String |
getPathForSound(java.lang.String soundName) |
static boolean |
isValidSoundName(java.lang.String soundName)
Returns true if the given sound name is not null and contains only valid characters.
|
static void |
renameSound(java.lang.String oldSoundName,
java.lang.String newSoundName)
Renames the sound file with the given name.
|
static void |
saveSoundFile(java.lang.String soundName,
java.lang.String base64Content)
Save a sound file.
|
public static final java.lang.String VALID_SOUND_REGEX
public static java.lang.String fetchSounds() throws java.io.IOException
java.io.IOException
public static boolean isValidSoundName(java.lang.String soundName)
public static java.lang.String fetchSoundFileContent(java.lang.String soundName) throws java.io.IOException
soundName
- the name of the soundjava.io.IOException
public static void saveSoundFile(java.lang.String soundName, java.lang.String base64Content) throws java.io.IOException
soundName
- the name of the soundcontent
- the content to write to the sound file.java.io.IOException
public static void renameSound(java.lang.String oldSoundName, java.lang.String newSoundName) throws java.io.IOException
oldSoundName
- the old name of the soundnewSoundName
- the new name of the soundjava.io.IOException
public static void copySound(java.lang.String oldSoundName, java.lang.String newSoundName) throws java.io.IOException
oldSoundName
- the old name of the soundnewSoundName
- the new name of the soundjava.io.IOException
public static boolean deleteSounds(java.lang.String[] soundNames)
soundNames
- the names of the sounds to deletepublic static java.lang.String getPathForSound(java.lang.String soundName)