|
||||||||||
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 Class[] |
EMPTY_CLASSES
|
static Enumeration |
EMPTY_ENUMERATION
|
static Object[] |
EMPTY_OBJECTS
|
protected static byte |
EQUALS_SIGN
The equals sign (=) as a byte. |
protected static byte |
EQUALS_SIGN_ENC
|
static String |
ISO_8859_1
|
protected static byte |
WHITE_SPACE_ENC
|
Constructor Summary | |
---|---|
Utils()
|
Method Summary | |
---|---|
static String |
base64Decode(String _s,
String _enc)
base 64 decoding |
static String |
base64Encode(byte[] _bytes)
base 64 encoding, array of bytes converted to bytes using specified encoding |
static String |
base64Encode(String _s,
String _enc)
base 64 encoding, string converted to bytes using specified encoding |
static String |
calculateClassPath(ClassLoader cl)
calculate local file based class path for class loader if possible (servlet classes must be located there) |
static String |
canonicalizePath(String path)
|
static String[] |
copyOf(String[] original,
int newLength)
|
static String[] |
copyOfRange(String[] original,
int from,
int newLength)
|
static void |
copyStream(InputStream in,
OutputStream out,
long maxLen)
|
static void |
copyStream(Reader in,
OutputStream out,
String charSet)
|
static void |
copyStream(Reader in,
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 String |
decode(String s,
String enc)
Decodes URL encoded string including newly introduced JavaScript encoding with %uxxxx chars |
static byte[] |
decode64(String s)
Decodes data from Base64 notation, automatically detecting gzip-compressed data and decompressing it. |
static String |
htmlEncode(String s,
boolean encodeWS)
|
static float |
isGzipAccepted(String contentEncoding)
|
static String |
lsDateStr(Date date)
|
static void |
main(String[] args)
|
static boolean |
match(String pattern,
String string)
|
static int |
matchSpan(String pattern,
String string)
|
static Map |
parsePostData(long len,
InputStream is,
String encoding,
String[] cachedStream)
|
static Hashtable |
parseQueryString(String query,
String encoding)
|
static String[] |
splitStr(String str)
|
static String[] |
splitStr(String str,
char delim)
|
static String[] |
splitStr(String str,
String quotes)
|
static String |
toFile(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 String ISO_8859_1
public static final Class[] EMPTY_CLASSES
public static final Object[] EMPTY_OBJECTS
public static final 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 String lsDateStr(Date date)
public static Hashtable parseQueryString(String query, String encoding)
public static Map parsePostData(long len, InputStream is, String encoding, String[] cachedStream) throws IOException
IOException
public static String decode(String s, String enc) throws UnsupportedEncodingException
s
- encoded stringenc
- source encoding
UnsupportedEncodingException
public static String htmlEncode(String s, boolean encodeWS)
public static float isGzipAccepted(String contentEncoding)
public static boolean match(String pattern, String string)
public static int matchSpan(String pattern, String string)
public static String[] splitStr(String str)
public static String[] splitStr(String str, char delim)
public static String[] splitStr(String str, String quotes)
public static String[] copyOf(String[] original, int newLength)
public static String[] copyOfRange(String[] original, int from, int newLength)
public static String canonicalizePath(String path)
public static void copyStream(InputStream in, OutputStream out, long maxLen) throws IOException
IOException
public static void copyStream(Reader in, Writer out) throws IOException
IOException
public static void copyStream(Reader in, OutputStream out, String charSet) throws IOException
IOException
public static final String base64Encode(String _s, String _enc)
String
- String
- encoding, can be null, then iso-8859-1 used
no
- exceptionspublic static final String base64Encode(byte[] _bytes)
String
- String
- encoding, can be null, then iso-8859-1 used
NullPointerException
- if input parameter is nullpublic static final String base64Decode(String _s, 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(String s)
s
- the string to decode
public static String calculateClassPath(ClassLoader cl)
cl
- class loader
public static final String toFile(URL url)
public static void main(String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |