swpchat.client
Class AudioMapper

java.lang.Object
  |
  +--swpchat.client.SWPConfig
        |
        +--swpchat.client.AudioMapper

public class AudioMapper
extends SWPConfig

Class to handle URL for Audiofiles. AudioMapper uses swpProps from Superclass SWPConfig. URLs can be saved with setAudioURL, fetched with getAudioURL and deleted from the Properties file with removeAudioURL.


Field Summary
(package private) static java.lang.String CLS
           
private static java.lang.String STR_FILE
           
private static java.lang.String STR_FTP
           
private static java.lang.String STR_RESOURCE
           
 
Fields inherited from class swpchat.client.SWPConfig
PKConfigFileName, swpProps
 
Constructor Summary
AudioMapper()
           
 
Method Summary
 java.net.URL getAudioURL(java.lang.String strAudioKey)
          Returns a URL built from the value of the Property specified by strAudioKey.
 void removeAudioURL(java.lang.String strAudioKey)
          remove Audio-URL from the Properties
 void setAudioURL(java.lang.String strAudioKey, java.lang.String strInto)
          Gives a Property specified by strAudioKey the value of a URL built from strInto.
 
Methods inherited from class swpchat.client.SWPConfig
getConfigFileName, getStoredProperties, propertyKeys, save
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

CLS

static final java.lang.String CLS

STR_FILE

private static final java.lang.String STR_FILE

STR_FTP

private static final java.lang.String STR_FTP

STR_RESOURCE

private static final java.lang.String STR_RESOURCE
Constructor Detail

AudioMapper

public AudioMapper()
Method Detail

setAudioURL

public void setAudioURL(java.lang.String strAudioKey,
                        java.lang.String strInto)
Gives a Property specified by strAudioKey the value of a URL built from strInto. Thence strInto has to be a String representation of a URL to an audiofile, information on how a URL has to be defined correctly can be found at URL. If the Property doesn't exist it will be created.
Parameters:
strAudioKey - the key of the Property to set.
strInto - the Path to the audiofile

removeAudioURL

public void removeAudioURL(java.lang.String strAudioKey)
remove Audio-URL from the Properties
Parameters:
strAudioKey - the Audio to remove

getAudioURL

public java.net.URL getAudioURL(java.lang.String strAudioKey)
                         throws java.net.MalformedURLException
Returns a URL built from the value of the Property specified by strAudioKey. If swpProps doesn't contain the key, getAudioURL will return a URL to a file in a default directory while the name of the file will be the suffix of strAudioKey and concatenated '.wav' to it.
Parameters:
strAudioKey - the key to search
Returns:
the URL from the Audio