|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Acme.Utils
public class Utils
Nested Class Summary | |
---|---|
static class |
Utils.DummyPrintStream
|
static class |
Utils.SimpleBuffer
|
static interface |
Utils.ThreadFactory
|
static class |
Utils.ThreadPool
|
Field Summary | |
---|---|
protected static char[] |
BASE64ARRAY
|
static int |
COPY_BUF_SIZE
|
protected static byte[] |
DECODABET
Translates a Base64 value to either its 6-bit reconstruction value or a negative number indicating some other meaning. |
static java.lang.Class[] |
EMPTY_CLASSES
|
static java.util.Enumeration |
EMPTY_ENUMERATION
|
static java.lang.Object[] |
EMPTY_OBJECTS
|
protected static byte |
EQUALS_SIGN
The equals sign (=) as a byte. |
protected static byte |
EQUALS_SIGN_ENC
|
static java.lang.String |
ISO_8859_1
|
protected static byte |
WHITE_SPACE_ENC
|
Constructor Summary | |
---|---|
Utils()
|
Method Summary | |
---|---|
static java.lang.String |
base64Decode(java.lang.String _s,
java.lang.String _enc)
base 64 decoding |
static java.lang.String |
base64Encode(byte[] _bytes)
base 64 encoding, array of bytes converted to bytes using specified encoding |
static java.lang.String |
base64Encode(java.lang.String _s,
java.lang.String _enc)
base 64 encoding, string converted to bytes using specified encoding |
static java.lang.String |
calculateClassPath(java.lang.ClassLoader cl)
calculate local file based class path for class loader if possible (servlet classes must be located there) |
static java.lang.String |
canonicalizePath(java.lang.String path)
|
static java.lang.String[] |
copyOf(java.lang.String[] original,
int newLength)
|
static java.lang.String[] |
copyOfRange(java.lang.String[] original,
int from,
int newLength)
|
static void |
copyStream(java.io.InputStream in,
java.io.OutputStream out,
long maxLen)
|
static void |
copyStream(java.io.Reader in,
java.io.OutputStream out,
java.lang.String charSet)
|
static void |
copyStream(java.io.Reader in,
java.io.Writer out)
|
static byte[] |
decode(byte[] source,
int off,
int len)
Very low-level access to decoding ASCII characters in the form of a byte array. |
static java.lang.String |
decode(java.lang.String s,
java.lang.String enc)
Decodes URL encoded string including newly introduced JavaScript encoding with %uxxxx chars |
static byte[] |
decode64(java.lang.String s)
Decodes data from Base64 notation, automatically detecting gzip-compressed data and decompressing it. |
static java.lang.String |
htmlEncode(java.lang.String s,
boolean encodeWS)
|
static float |
isGzipAccepted(java.lang.String contentEncoding)
|
static java.lang.String |
lsDateStr(java.util.Date date)
|
static void |
main(java.lang.String[] args)
|
static boolean |
match(java.lang.String pattern,
java.lang.String string)
|
static int |
matchSpan(java.lang.String pattern,
java.lang.String string)
|
static java.util.Map |
parsePostData(long len,
java.io.InputStream is,
java.lang.String encoding,
java.lang.String[] cachedStream)
|
static java.util.Hashtable |
parseQueryString(java.lang.String query,
java.lang.String encoding)
|
static java.lang.String[] |
splitStr(java.lang.String str)
|
static java.lang.String[] |
splitStr(java.lang.String str,
char delim)
|
static java.lang.String[] |
splitStr(java.lang.String str,
java.lang.String quotes)
|
static java.lang.String |
toFile(java.net.URL url)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int COPY_BUF_SIZE
public static final java.lang.String ISO_8859_1
public static final java.lang.Class[] EMPTY_CLASSES
public static final java.lang.Object[] EMPTY_OBJECTS
public static final java.util.Enumeration EMPTY_ENUMERATION
protected static final char[] BASE64ARRAY
protected static final byte[] DECODABET
protected static final byte WHITE_SPACE_ENC
protected static final byte EQUALS_SIGN_ENC
protected static final byte EQUALS_SIGN
Constructor Detail |
---|
public Utils()
Method Detail |
---|
public static java.lang.String lsDateStr(java.util.Date date)
public static java.util.Hashtable parseQueryString(java.lang.String query, java.lang.String encoding)
public static java.util.Map parsePostData(long len, java.io.InputStream is, java.lang.String encoding, java.lang.String[] cachedStream) throws java.io.IOException
java.io.IOException
public static java.lang.String decode(java.lang.String s, java.lang.String enc) throws java.io.UnsupportedEncodingException
s
- encoded stringenc
- source encoding
java.io.UnsupportedEncodingException
public static java.lang.String htmlEncode(java.lang.String s, boolean encodeWS)
public static float isGzipAccepted(java.lang.String contentEncoding)
public static boolean match(java.lang.String pattern, java.lang.String string)
public static int matchSpan(java.lang.String pattern, java.lang.String string)
public static java.lang.String[] splitStr(java.lang.String str)
public static java.lang.String[] splitStr(java.lang.String str, char delim)
public static java.lang.String[] splitStr(java.lang.String str, java.lang.String quotes)
public static java.lang.String[] copyOf(java.lang.String[] original, int newLength)
public static java.lang.String[] copyOfRange(java.lang.String[] original, int from, int newLength)
public static java.lang.String canonicalizePath(java.lang.String path)
public static void copyStream(java.io.InputStream in, java.io.OutputStream out, long maxLen) throws java.io.IOException
java.io.IOException
public static void copyStream(java.io.Reader in, java.io.Writer out) throws java.io.IOException
java.io.IOException
public static void copyStream(java.io.Reader in, java.io.OutputStream out, java.lang.String charSet) throws java.io.IOException
java.io.IOException
public static final java.lang.String base64Encode(java.lang.String _s, java.lang.String _enc)
String
- String
- encoding, can be null, then iso-8859-1 used
no
- exceptionspublic static final java.lang.String base64Encode(byte[] _bytes)
String
- String
- encoding, can be null, then iso-8859-1 used
NullPointerException
- if input parameter is nullpublic static final java.lang.String base64Decode(java.lang.String _s, java.lang.String _enc)
encoded
- stringencoding
- used to get string bytes
public static byte[] decode(byte[] source, int off, int len)
source
- The Base64 encoded dataoff
- The offset of where to begin decodinglen
- The length of characters to decode
public static byte[] decode64(java.lang.String s)
s
- the string to decode
public static java.lang.String calculateClassPath(java.lang.ClassLoader cl)
cl
- class loader
public static final java.lang.String toFile(java.net.URL url)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |