|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.extrememessaging.ResponseMaster.CHelper
public class CHelper
Some helper functions that are useful in many places in ResponseMaster and may be useful to others working on response handling
Constructor Summary | |
---|---|
CHelper()
|
Method Summary | |
---|---|
static boolean |
addressLooksValid(java.lang.String sAddress)
Does some basic checks to see if a string looks like a legit email address |
static char |
decodeEscapedSequenceForHTML(java.lang.String sEscapeSequence)
Decode an HTML escaped sequence to a character. |
static java.lang.String |
DecodeMimeText(java.lang.String input)
Decodes mime text, eg =?utf-8?B?5a+m6Zqb44SJ6KiI55WrLnppcA==?= |
static char |
decodeQP(char firstChar,
char secondChar)
|
static java.lang.String |
decryptPassword(java.lang.String sInput)
Decrypts the string if it is encrypted, otherwise, just gives it back |
static java.lang.String |
encryptPassword(java.lang.String sInput)
Encrypts the string if it is decrypted, otherwise, just gives it back |
static java.lang.String |
getAddress(javax.mail.Address address)
Gets the address (not the display name) from an Address object |
static java.lang.String |
getAddressWithName(javax.mail.Address address)
Gets the display name and address from an Address object |
static int |
getEOLIndex(java.lang.String sInput,
int nIndex)
Used to find the index of the end of the line containing an index. |
static byte[] |
getFromHex(java.lang.String input)
|
static java.lang.String |
getHex(byte[] ba)
|
static java.lang.String |
GetPlainMimeType(java.lang.String input)
Turns something like application/pdf; name="fax-072508-1249.pdf" into application/pdf |
static java.lang.String |
getStackDump(java.lang.Throwable input)
Gets a string containing the stack dump from an exception or error |
static java.lang.String |
getTokenAtPosition(java.lang.String sInput,
int nIndex)
Gets the word at a location, treating < and > and " and : as whitespace |
static java.lang.String |
HandleRelativeConfigFileName(java.lang.String sContainingFileName,
java.lang.String sChildFileName)
Returns a filename suitable for use by the operating system given the filename that refers to the file, and the file that is referred to. |
static boolean |
IsDigits(java.lang.String input)
|
static boolean |
IsHex(java.lang.String input)
|
static boolean |
IsUppercaseHex(java.lang.String input)
|
static java.lang.String |
NullToEmptyString(java.lang.String input)
|
static byte[] |
ReadToEnd(java.io.InputStream is)
|
static java.lang.String |
replaceString(java.lang.String sInput,
java.lang.String sSearchFor,
java.lang.String sNewString,
boolean bIgnoreCase)
Replaces all instances of sSearchFor in sInput with sNewString |
static void |
Sleep(int milliseconds)
Sleeps the specified number of milliseconds without throwing an exception |
static java.lang.String |
StripCharacters(java.lang.String sInput,
char[] charactersToStrip)
Strips the whitespace from a string |
static java.lang.String |
StripCharactersEnd(java.lang.String sInput,
char[] charactersToStrip)
Strips the whitespace from the end of a string |
static java.lang.String |
StripCharactersFront(java.lang.String sInput,
char[] charactersToStrip)
Strips the whitespace from the front of a string |
static java.lang.String |
StripCharactersFrontAndEnd(java.lang.String sInput,
char[] charactersToStrip)
Strips the whitespace from both ends of a string |
static java.lang.String |
StripWhitespace(java.lang.String sInput)
Strips the whitespace from a string |
static java.lang.String |
StripWhitespaceForRules(java.lang.String sInput)
Strips the whitespace from a string and some other special characters (eg underscores) |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CHelper()
Method Detail |
---|
public static void Sleep(int milliseconds)
public static java.lang.String replaceString(java.lang.String sInput, java.lang.String sSearchFor, java.lang.String sNewString, boolean bIgnoreCase)
sInput
- The original stringsSearchFor
- The string to search forsNewString
- The string to replace it withbIgnoreCase
- True if you want to ignore case when searching for sSearchFor
public static char decodeQP(char firstChar, char secondChar)
public static char decodeEscapedSequenceForHTML(java.lang.String sEscapeSequence) throws ResponseMasterDecodingException
sEscapeSequence
- The string to decode (e.g. 'lt'). It does not include the
& or the semicolon.
Throws
- a ResponseMasterDecodingException if there is a problem
ResponseMasterDecodingException
public static java.lang.String decryptPassword(java.lang.String sInput)
public static java.lang.String encryptPassword(java.lang.String sInput)
public static java.lang.String getTokenAtPosition(java.lang.String sInput, int nIndex)
sInput
- The string to get the token fromnIndex
- A position that is in the token or in whitespace before the token
public static int getEOLIndex(java.lang.String sInput, int nIndex)
sInput
- The big stringnIndex
- The index of a character in the line that you want the end of
public static java.lang.String getStackDump(java.lang.Throwable input)
public static java.lang.String getAddress(javax.mail.Address address)
public static java.lang.String getAddressWithName(javax.mail.Address address)
public static java.lang.String NullToEmptyString(java.lang.String input)
public static java.lang.String StripWhitespace(java.lang.String sInput)
public static java.lang.String StripWhitespaceForRules(java.lang.String sInput)
public static java.lang.String StripCharacters(java.lang.String sInput, char[] charactersToStrip)
public static java.lang.String StripCharactersFront(java.lang.String sInput, char[] charactersToStrip)
public static java.lang.String StripCharactersFrontAndEnd(java.lang.String sInput, char[] charactersToStrip)
public static java.lang.String StripCharactersEnd(java.lang.String sInput, char[] charactersToStrip)
public static java.lang.String DecodeMimeText(java.lang.String input)
public static java.lang.String HandleRelativeConfigFileName(java.lang.String sContainingFileName, java.lang.String sChildFileName)
public static java.lang.String getHex(byte[] ba)
public static byte[] getFromHex(java.lang.String input) throws ResponseMasterException
ResponseMasterException
public static byte[] ReadToEnd(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public static boolean IsDigits(java.lang.String input)
public static boolean IsHex(java.lang.String input)
public static boolean IsUppercaseHex(java.lang.String input)
public static java.lang.String GetPlainMimeType(java.lang.String input)
public static boolean addressLooksValid(java.lang.String sAddress)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |