|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.portal.migration.helper.Tools
Field Summary | |
static int |
DEFAULT_BUFFER_SIZE
|
static java.util.ResourceBundle |
EMPTY_BUNDLE
|
static java.util.Enumeration |
EMPTY_ENUMERATION
|
static java.util.Iterator |
EMPTY_ITERATOR
|
static org.apache.log4j.Logger |
log
|
static java.lang.String |
RE_EMAIL_VALIDATION
|
static java.lang.String |
VMID
16 chars long VMID. |
Constructor Summary | |
Tools()
|
Method Summary | |
static java.lang.String |
buildClassLoaderInfo(java.lang.ClassLoader loader)
|
static int |
computeStringHash(int hash,
java.lang.String s)
|
static boolean |
confirmTemporaryHash(java.lang.String hash,
java.lang.String value,
long time)
|
static void |
copy(java.io.InputStream in,
java.io.OutputStream out)
Pipe an input stream in an output stream. |
static void |
copy(java.io.InputStream in,
java.io.OutputStream out,
int bufferSize)
Pipe an incoming stream in an outcoming stream. |
static java.lang.String |
decodeXWWWFormURL(java.lang.String s)
|
static java.lang.String |
dumpClassLoaderHierarchyInfo(java.lang.ClassLoader loader)
|
static void |
dumpClassLoaderHierarchyInfo(org.apache.log4j.Logger log,
java.lang.ClassLoader loader)
|
static void |
dumpClassLoaderHierarchyInfo(org.apache.log4j.Logger log,
org.apache.log4j.Level level,
java.lang.ClassLoader loader)
|
static void |
dumpClassLoaderHierarchyInfo(java.io.Writer writer,
java.lang.ClassLoader loader)
|
static java.lang.String |
encodeXWWWFormURL(java.lang.String s)
|
static boolean |
exists(java.net.URL url)
|
static byte[] |
fromHexString(java.lang.String hex)
Returns a byte array converted from the hexadecimal format. |
static java.lang.String |
generateTemporaryHash(java.lang.String value,
long time)
|
static boolean |
isEmailValid(java.lang.String address)
Return true is the address is not null and matches the email validation regular expression. |
static java.util.Iterator |
iterator(java.lang.Object o)
|
static java.util.Iterator |
iterator(java.lang.Object[] objects)
|
static byte[] |
md5(java.lang.String text)
Computes an md5 hash of a string. |
static java.lang.String |
md5AsHexString(java.lang.String text)
Computes an md5 hash and returns the result as a string in hexadecimal format. |
static java.lang.String |
replace(java.lang.String string,
java.lang.String pattern,
java.lang.String replacement)
Replace occurence in a string. |
static void |
safeClose(java.io.InputStream in)
Close an input stream safely. |
static void |
safeClose(java.lang.Object closable)
Close an object that implements a close() method. |
static void |
safeClose(java.io.OutputStream out)
Close an output stream safely. |
static void |
safeClose(java.io.Reader reader)
Close a reader safely. |
static java.util.Enumeration |
toEnumeration(java.util.Iterator iterator)
|
static java.lang.String |
toHexString(byte[] bytes)
Returns a string in the hexadecimal format. |
static java.util.List |
toList(java.util.Enumeration e)
|
static java.util.List |
toList(java.util.Iterator iterator)
|
static java.util.Set |
toSet(java.util.Enumeration e)
|
static java.util.Set |
toSet(java.util.Iterator iterator)
|
static java.util.Set |
toSet(java.lang.Object[] objects)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT_BUFFER_SIZE
public static final org.apache.log4j.Logger log
public static final java.lang.String RE_EMAIL_VALIDATION
public static final java.lang.String VMID
public static final java.util.Enumeration EMPTY_ENUMERATION
public static final java.util.Iterator EMPTY_ITERATOR
public static final java.util.ResourceBundle EMPTY_BUNDLE
Constructor Detail |
public Tools()
Method Detail |
public static void safeClose(java.lang.Object closable)
closable
- the object to closepublic static void safeClose(java.io.OutputStream out)
out
- the stream to closepublic static void safeClose(java.io.InputStream in)
in
- the stream to closepublic static void safeClose(java.io.Reader reader)
reader
- the stream to closepublic static void copy(java.io.InputStream in, java.io.OutputStream out) throws java.io.IOException
in
- the incoming streamout
- the outcoming stream
java.lang.NullPointerException
- if an argument is null
java.lang.IllegalArgumentException
- if bufferSize < 1
java.io.IOException
public static void copy(java.io.InputStream in, java.io.OutputStream out, int bufferSize) throws java.io.IOException
in
- the incoming streamout
- the outcoming streambufferSize
- the buffer size
java.lang.NullPointerException
- if an argument is null
java.lang.IllegalArgumentException
- if bufferSize < 1
java.io.IOException
public static java.util.Enumeration toEnumeration(java.util.Iterator iterator)
public static java.util.Set toSet(java.util.Enumeration e)
public static java.util.List toList(java.util.Enumeration e)
public static java.util.Set toSet(java.lang.Object[] objects)
public static java.util.Set toSet(java.util.Iterator iterator)
public static java.util.List toList(java.util.Iterator iterator)
public static java.util.Iterator iterator(java.lang.Object o)
public static java.util.Iterator iterator(java.lang.Object[] objects)
public static int computeStringHash(int hash, java.lang.String s)
public static java.lang.String encodeXWWWFormURL(java.lang.String s)
public static java.lang.String decodeXWWWFormURL(java.lang.String s)
public static boolean isEmailValid(java.lang.String address)
public static byte[] md5(java.lang.String text)
text
- the hashed string
java.lang.NullPointerException
- if text is nullpublic static java.lang.String md5AsHexString(java.lang.String text)
text
- the hashed string
java.lang.NullPointerException
- if text is nullpublic static java.lang.String toHexString(byte[] bytes)
bytes
- the converted bytes
java.lang.IllegalArgumentException
- if the byte array is nullpublic static byte[] fromHexString(java.lang.String hex)
hex
- the string to convert
java.lang.IllegalArgumentException
- if the string is null or does not have the good formatpublic static java.lang.String generateTemporaryHash(java.lang.String value, long time)
public static boolean confirmTemporaryHash(java.lang.String hash, java.lang.String value, long time)
public static java.lang.String buildClassLoaderInfo(java.lang.ClassLoader loader)
public static java.lang.String dumpClassLoaderHierarchyInfo(java.lang.ClassLoader loader)
public static void dumpClassLoaderHierarchyInfo(java.io.Writer writer, java.lang.ClassLoader loader)
public static void dumpClassLoaderHierarchyInfo(org.apache.log4j.Logger log, java.lang.ClassLoader loader)
public static void dumpClassLoaderHierarchyInfo(org.apache.log4j.Logger log, org.apache.log4j.Level level, java.lang.ClassLoader loader)
public static java.lang.String replace(java.lang.String string, java.lang.String pattern, java.lang.String replacement)
string
- the source stringpattern
- the replaced patternreplacement
- the replacement text
public static boolean exists(java.net.URL url)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |