|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectunsw.cse.mica.util.MicaUtils
public class MicaUtils
Utility methods used by MICA
Field Summary | |
---|---|
static java.lang.String |
MICA_TIMESTAMP_FORMAT
The MICA timestamp format. |
Constructor Summary | |
---|---|
MicaUtils()
|
Method Summary | |
---|---|
static java.lang.String |
currentTimeToString()
Convert the current time into a mica time string |
static java.lang.String |
escape(java.lang.String input)
convert a string into an form suitable for transmission in XML. |
static java.util.Properties |
load(java.lang.String resource)
Wrapper for the load(String,String,boolean,boolean) method below,
allowing both user dir and local dir to override. |
static java.util.Properties |
load(java.lang.String resource,
java.lang.String location,
boolean homeOverride,
boolean localOverride)
Load a java properties file from the given resource. |
static java.lang.String |
replaceAll(java.lang.String str,
java.util.Properties properties)
Replaces each occurrence of "${PROPERTY}" with VALUE, where PROPERTY is a property defined in 'properties' and VALUE is its corresponding value. |
static java.lang.String |
replaceAll(java.lang.String target,
java.lang.String oldStr,
java.lang.String newStr)
Replace all occurrences of oldStr in target by newStr. |
static long |
stringToTime(java.lang.String str)
Convert a Mica time string into a time ms. |
static java.lang.String |
timeToString(long time)
Convert a time into a mica time string Taken from the old Blackboard getTime() method |
static java.lang.String |
toString(org.xml.sax.Attributes atts)
Create a String representation of an Attributes object. |
static java.lang.String |
unescape(java.lang.String input)
converts escaped XML characters back to their original form. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String MICA_TIMESTAMP_FORMAT
Constructor Detail |
---|
public MicaUtils()
Method Detail |
---|
public static java.lang.String currentTimeToString()
public static java.lang.String timeToString(long time)
time
- the time to be converted
public static long stringToTime(java.lang.String str)
str
- a string representing a time in the Mica time format
public static java.lang.String escape(java.lang.String input)
input
- the string to be escaped
public static java.lang.String unescape(java.lang.String input)
escape(String input)
.
input
- the string to be unescaped
public static java.lang.String replaceAll(java.lang.String target, java.lang.String oldStr, java.lang.String newStr)
target
- the string to have its contents replacedoldStr
- the substring to be replacednewStr
- the replacement for each occurrence of the substring
oldStr
in target
has beemn replaced by newStr
public static java.lang.String replaceAll(java.lang.String str, java.util.Properties properties)
str
- properties
-
public static java.lang.String toString(org.xml.sax.Attributes atts)
Attributes
object. Useful for debugging.
atts
- the attributes object
public static java.util.Properties load(java.lang.String resource)
load(String,String,boolean,boolean)
method below,
allowing both user dir and local dir to override.
resource
- the name of the resource file to load.
public static java.util.Properties load(java.lang.String resource, java.lang.String location, boolean homeOverride, boolean localOverride)
resource
- the name of the resource filelocation
- the location of the resource filehomeOverride
- a flag specifiying whether or not the properties file can be overridden by a file in the
user's home directory with the same name (if such a file exists)localOverride
- a flag specifiying whether or not the properties file can be overridden by a file in the
local directory with the same name (if such a file exists)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |