![]() |
![]() |
selenium-server-standalone-2.42.2va/lang/StringBuffer:toString ()Ljava/lang/String; // 666: areturn // Line number table: // Java source line #829 -> byte code offset #0 // Java source line #830 -> byte code offset #11 // Java source line #832 -> byte code offset #13 // Java source line #833 -> byte code offset #18 // Java source line #834 -> byte code offset #25 // Java source line #837 -> byte code offset #41 // Java source line #839 -> byte code offset #44 // Java source line #842 -> byte code offset #68 // Java source line #843 -> byte code offset #80 // Java source line #846 -> byte code offset #83 // Java source line #851 -> byte code offset #107 // Java source line #852 -> byte code offset #109 // Java source line #837 -> byte code offset #119 // Java source line #856 -> byte code offset #123 // Java source line #857 -> byte code offset #128 // Java source line #859 -> byte code offset #130 // Java source line #860 -> byte code offset #140 // Java source line #861 -> byte code offset #143 // Java source line #862 -> byte code offset #146 // Java source line #864 -> byte code offset #149 // Java source line #866 -> byte code offset #152 // Java source line #869 -> byte code offset #176 // Java source line #871 -> byte code offset #189 // Java source line #873 -> byte code offset #202 // Java source line #874 -> byte code offset #213 // Java source line #875 -> byte code offset #242 // Java source line #877 -> byte code offset #245 // Java source line #880 -> byte code offset #248 // Java source line #881 -> byte code offset #283 // Java source line #883 -> byte code offset #286 // Java source line #884 -> byte code offset #291 // Java source line #885 -> byte code offset #294 // Java source line #886 -> byte code offset #297 // Java source line #888 -> byte code offset #319 // Java source line #889 -> byte code offset #322 // Java source line #890 -> byte code offset #344 // Java source line #891 -> byte code offset #347 // Java source line #893 -> byte code offset #350 // Java source line #894 -> byte code offset #359 // Java source line #896 -> byte code offset #362 // Java source line #897 -> byte code offset #367 // Java source line #898 -> byte code offset #370 // Java source line #897 -> byte code offset #373 // Java source line #899 -> byte code offset #388 // Java source line #902 -> byte code offset #391 // Java source line #904 -> byte code offset #417 // Java source line #905 -> byte code offset #430 // Java source line #906 -> byte code offset #441 // Java source line #907 -> byte code offset #470 // Java source line #909 -> byte code offset #473 // Java source line #912 -> byte code offset #476 // Java source line #913 -> byte code offset #479 // Java source line #914 -> byte code offset #484 // Java source line #916 -> byte code offset #487 // Java source line #917 -> byte code offset #490 // Java source line #918 -> byte code offset #495 // Java source line #919 -> byte code offset #498 // Java source line #918 -> byte code offset #501 // Java source line #920 -> byte code offset #516 // Java source line #923 -> byte code offset #519 // Java source line #925 -> byte code offset #532 // Java source line #926 -> byte code offset #543 // Java source line #927 -> byte code offset #567 // Java source line #932 -> byte code offset #570 // Java source line #934 -> byte code offset #585 // Java source line #935 -> byte code offset #595 // Java source line #936 -> byte code offset #601 // Java source line #937 -> byte code offset #606 // Java source line #940 -> byte code offset #609 // Java source line #941 -> byte code offset #614 // Java source line #942 -> byte code offset #617 // Java source line #941 -> byte code offset #620 // Java source line #864 -> byte code offset #635 // Java source line #946 -> byte code offset #639 // Java source line #947 -> byte code offset #644 // Java source line #950 -> byte code offset #646 // Java source line #951 -> byte code offset #651 // Java source line #953 -> byte code offset #661 // Local variable table: // start length slot name signature // 0 667 0 path String // 17 619 1 end int // 24 9 2 queryIdx int // 40 587 3 start int // 138 524 4 buf StringBuffer // 141 513 5 delStart int // 144 512 6 delEnd int // 147 493 7 skip int } public static boolean hasScheme(String uri) { for (int i = 0; i < uri.length(); i++) { char c = uri.charAt(i); if (c == ':') { return true; } if (((c < 'a') || (c > 'z')) && ((c < 'A') || (c > 'Z')) && ( (i <= 0) || (((c < '0') || (c > '9')) && (c != '.') && (c != '+') && (c != '-')))) { break; } } return false; } } /* Location: * Qualified Name: org.openqa.jetty.util.URI * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.jetty.util; import java.io.File; import java.io.FilePermission; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.security.Permission; import org.apache.commons.logging.Log; import org.openqa.jetty.log.LogFactory; public class URLResource extends Resource { private static Log log = LogFactory.getLog(URLResource.class); protected URL _url; protected String _urlString; protected transient URLConnection _connection; protected transient InputStream _in = null; protected URLResource(URL url, URLConnection connection) { _url = url; _urlString = _url.toString(); _connection = connection; } protected synchronized boolean checkConnection() { if (_connection == null) { try { _connection = _url.openConnection(); } catch (IOException e) { LogSupport.ignore(log, e); } } return _connection != null; } public synchronized void release() { if (_in != null) { try { _in.close(); } catch (IOException e) { LogSupport.ignore(log, e); } _in = null; } if (_connection != null) { _connection = null; } } public boolean exists() { try { synchronized (this) { if ((checkConnection()) && (_in == null)) { _in = _connection.getInputStream(); } } } catch (IOException e) { LogSupport.ignore(log, e); if (_in != null) { return true; } } return false; } public boolean isDirectory() { return (exists()) && (_url.toString().endsWith("/")); } public long lastModified() { if (checkConnection()) { return _connection.getLastModified(); } return -1L; } public long length() { if (checkConnection()) { return _connection.getContentLength(); } return -1L; } public URL getURL() { return _url; } public File getFile() throws IOException { if (checkConnection()) { Permission perm = _connection.getPermission(); if ((perm instanceof FilePermission)) { return new File(perm.getName()); } } try { return new File(_url.getFile()); } catch (Exception e) { LogSupport.ignore(log, e); } return null; } public String getName() { return _url.toExternalForm(); } public synchronized InputStream getInputStream() throws IOException { if (!checkConnection()) { throw new IOException("Invalid resource"); } try { InputStream localInputStream1; if (_in != null) { InputStream in = _in; _in = null; return in; } return _connection.getInputStream(); } finally { _connection = null; } } public OutputStream getOutputStream() throws IOException, SecurityException { throw new IOException("Output not supported"); } public boolean delete() throws SecurityException { throw new SecurityException("Delete not supported"); } public boolean renameTo(Resource dest) throws SecurityException { throw new SecurityException("RenameTo not supported"); } public String[] list() { return null; } public Resource addPath(String path) throws IOException, MalformedURLException { if (path == null) { return null; } path = URI.canonicalPath(path); return newResource(URI.addPaths(_url.toExternalForm(), path)); } public String toString() { return _urlString; } public int hashCode() { return _url.hashCode(); } public boolean equals(Object o) { return ((o instanceof URLResource)) && (_url.equals(_url)); } } /* Location: * Qualified Name: org.openqa.jetty.util.URLResource * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.jetty.util; import java.io.PrintStream; public class UnixCrypt { private static final byte[] IP = { 58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4, 62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8, 57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3, 61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7 }; private static final byte[] ExpandTr = { 32, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9, 8, 9, 10, 11, 12, 13, 12, 13, 14, 15, 16, 17, 16, 17, 18, 19, 20, 21, 20, 21, 22, 23, 24, 25, 24, 25, 26, 27, 28, 29, 28, 29, 30, 31, 32, 1 }; private static final byte[] PC1 = { 57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4 }; private static final byte[] Rotates = { 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1 }; private static final byte[] PC2 = { 9, 18, 14, 17, 11, 24, 1, 5, 22, 25, 3, 28, 15, 6, 21, 10, 35, 38, 23, 19, 12, 4, 26, 8, 43, 54, 16, 7, 27, 20, 13, 2, 0, 0, 41, 52, 31, 37, 47, 55, 0, 0, 30, 40, 51, 45, 33, 48, 0, 0, 44, 49, 39, 56, 34, 53, 0, 0, 46, 42, 50, 36, 29, 32 }; private static final byte[][] S = { { 14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7, 0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8, 4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0, 15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13 }, { 15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10, 3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5, 0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15, 13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9 }, { 10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8, 13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1, 13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7, 1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12 }, { 7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15, 13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9, 10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4, 3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14 }, { 2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9, 14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6, 4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14, 11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3 }, { 12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11, 10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8, 9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6, 4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13 }, { 4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1, 13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6, 1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2, 6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12 }, { 13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7, 1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2, 7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8, 2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11 } }; private static final byte[] P32Tr = { 16, 7, 20, 21, 29, 12, 28, 17, 1, 15, 23, 26, 5, 18, 31, 10, 2, 8, 24, 14, 32, 27, 3, 9, 19, 13, 30, 6, 22, 11, 4, 25 }; private static final byte[] CIFP = { 1, 2, 3, 4, 17, 18, 19, 20, 5, 6, 7, 8, 21, 22, 23, 24, 9, 10, 11, 12, 25, 26, 27, 28, 13, 14, 15, 16, 29, 30, 31, 32, 33, 34, 35, 36, 49, 50, 51, 52, 37, 38, 39, 40, 53, 54, 55, 56, 41, 42, 43, 44, 57, 58, 59, 60, 45, 46, 47, 48, 61, 62, 63, 64 }; private static final byte[] ITOA64 = { 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122 }; private static byte[] A64TOI = new byte['?']; private static long[][] PC1ROT = new long[16][16]; private static long[][][] PC2ROT = new long[2][16][16]; private static long[][] IE3264 = new long[8][16]; private static long[][] SPE = new long[8][64]; private static long[][] CF6464 = new long[16][16]; static { byte[] perm = new byte[64]; byte[] temp = new byte[64]; for (int i = 0; i < 64; i++) { A64TOI[ITOA64[i]] = ((byte)i); } for (int i = 0; i < 64; i++) { perm[i] = 0; } for (int i = 0; i < 64; i++) { int k; if ((k = PC2[i]) != 0) { k += Rotates[0] - 1; if (k % 28 < Rotates[0]) { k -= 28; } k = PC1[k]; if (k > 0) { k--; k = (k | 0x7) - (k & 0x7); k++; } perm[i] = ((byte)k); } } init_perm(PC1ROT, perm, 8); for (int j = 0; j < 2; j++) { for (int i = 0; i < 64; i++) { perm[i] = (temp[i] = 0); } for (int i = 0; i < 64; i++) { int k; if ((k = PC2[i]) != 0) { temp[(k - 1)] = ((byte)(i + 1)); } } for (int i = 0; i < 64; i++) { int k; if ((k = PC2[i]) != 0) { k += j; if (k % 28 <= j) { k -= 28; } perm[i] = temp[k]; } } init_perm(PC2ROT[j], perm, 8); } for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { int k = j < 2 ? 0 : IP[(ExpandTr[(i * 6 + j - 2)] - 1)]; if (k > 32) { k -= 32; } else if (k > 0) { k--; } if (k > 0) { k--; k = (k | 0x7) - (k & 0x7); k++; } perm[(i * 8 + j)] = ((byte)k); } } init_perm(IE3264, perm, 8); for (int i = 0; i < 64; i++) { int k = IP[(CIFP[i] - 1)]; if (k > 0) { k--; k = (k | 0x7) - (k & 0x7); k++; } perm[(k - 1)] = ((byte)(i + 1)); } init_perm(CF6464, perm, 8); for (int i = 0; i < 48; i++) { perm[i] = P32Tr[(ExpandTr[i] - 1)]; } for (int t = 0; t < 8; t++) { for (int j = 0; j < 64; j++) { int k = (j >> 0 & 0x1) << 5 | (j >> 1 & 0x1) << 3 | (j >> 2 & 0x1) << 2 | (j >> 3 & 0x1) << 1 | (j >> 4 & 0x1) << 0 | (j >> 5 & 0x1) << 4; k = S[t][k]; k = (k >> 3 & 0x1) << 0 | (k >> 2 & 0x1) << 1 | (k >> 1 & 0x1) << 2 | (k >> 0 & 0x1) << 3; for (int i = 0; i < 32; i++) { temp[i] = 0; } for (int i = 0; i < 4; i++) { temp[(4 * t + i)] = ((byte)(k >> i & 0x1)); } long kk = 0L; int i = 24; do { kk = kk << 1 | temp[(perm[i] - 1)] << 32 | temp[(perm[(i + 24)] - 1)];i--; } while (i >= 0); SPE[t][j] = to_six_bit(kk); } } } private static int to_six_bit(int num) { return num << 26 & 0xFC000000 | num << 12 & 0xFC0000 | num >> 2 & 0xFC00 | num >> 16 & 0xFC; } private static long to_six_bit(long num) { return num << 26 & 0xFC000000FC000000 | num << 12 & 0xFC000000FC0000 | num >> 2 & 0xFC000000FC00 | num >> 16 & 0xFC000000FC; } private static long perm6464(long c, long[][] p) { long out = 0L; int i = 8; do { int t = (int)(0xFF & c); c >>= 8; long tp = p[(i << 1)][(t & 0xF)]; out |= tp; tp = p[((i << 1) + 1)][(t >> 4)]; out |= tp;i--; } while (i >= 0); return out; } private static long perm3264(int c, long[][] p) { long out = 0L; int i = 4; do { int t = 0xFF & c; c >>= 8; long tp = p[(i << 1)][(t & 0xF)]; out |= tp; tp = p[((i << 1) + 1)][(t >> 4)]; out |= tp;i--; } while (i >= 0); return out; } private static long[] des_setkey(long keyword) { long K = perm6464(keyword, PC1ROT); long[] KS = new long[16]; KS[0] = (K & 0xFCFCFCFCFFFFFFFF); for (int i = 1; i < 16; i++) { KS[i] = K; K = perm6464(K, PC2ROT[(Rotates[i] - 1)]); KS[i] = (K & 0xFCFCFCFCFFFFFFFF); } return KS; } private static long des_cipher(long in, int salt, int num_iter, long[] KS) { salt = to_six_bit(salt); long L = in; long R = L; L &= 0x5555555555555555; R = R & 0xAAAAAAAA00000000 | R >> 1 & 0x55555555; L = (L << 1 | L << 32) & 0xFFFFFFFF00000000 | (R | R >> 32) & 0xFFFFFFFF; L = perm3264((int)(L >> 32), IE3264); R = perm3264((int)(L & 0xFFFFFFFFFFFFFFFF), IE3264); do { for (int loop_count = 0; loop_count < 8; loop_count++) { long kp = KS[(loop_count << 1)]; long k = (R >> 32 ^ R) & salt & 0xFFFFFFFF; k |= k << 32; long B = k ^ R ^ kp; L = L ^ SPE[0][((int)(B >> 58 & 0x3F))] ^ SPE[1][((int)(B >> 50 & 0x3F))] ^ SPE[2][((int)(B >> 42 & 0x3F))] ^ SPE[3][((int)(B >> 34 & 0x3F))] ^ SPE[4][((int)(B >> 26 & 0x3F))] ^ SPE[5][((int)(B >> 18 & 0x3F))] ^ SPE[6][((int)(B >> 10 & 0x3F))] ^ SPE[7][((int)(B >> 2 & 0x3F))]; kp = KS[((loop_count << 1) + 1)]; k = (L >> 32 ^ L) & salt & 0xFFFFFFFF; k |= k << 32; B = k ^ L ^ kp; R = R ^ SPE[0][((int)(B >> 58 & 0x3F))] ^ SPE[1][((int)(B >> 50 & 0x3F))] ^ SPE[2][((int)(B >> 42 & 0x3F))] ^ SPE[3][((int)(B >> 34 & 0x3F))] ^ SPE[4][((int)(B >> 26 & 0x3F))] ^ SPE[5][((int)(B >> 18 & 0x3F))] ^ SPE[6][((int)(B >> 10 & 0x3F))] ^ SPE[7][((int)(B >> 2 & 0x3F))]; } L ^= R; R ^= L; L ^= R;num_iter--; } while (num_iter >= 0); L = (L >> 35 & 0xF0F0F0F | (L & 0xFFFFFFFFFFFFFFFF) << 1 & 0xF0F0F0F0) << 32 | R >> 35 & 0xF0F0F0F | (R & 0xFFFFFFFFFFFFFFFF) << 1 & 0xF0F0F0F0; L = perm6464(L, CF6464); return L; } private static void init_perm(long[][] perm, byte[] p, int chars_out) { for (int k = 0; k < chars_out * 8; k++) { int l = p[k] - 1; if (l >= 0) { int i = l >> 2; l = 1 << (l & 0x3); for (int j = 0; j < 16; j++) { int s = (k & 0x7) + (7 - (k >> 3) << 3); if ((j & l) != 0) { perm[i][j] |= 1L << s; } } } } } public static String crypt(String key, String setting) { long constdatablock = 0L; byte[] cryptresult = new byte[13]; long keyword = 0L; if ((key == null) || (setting == null)) { return "*"; } int keylen = key.length(); for (int i = 0; i < 8; i++) { keyword = keyword << 8 | (i < keylen ? '\002' * key.charAt(i) : 0); } long[] KS = des_setkey(keyword); int salt = 0; int i = 2; do { char c = i < setting.length() ? setting.charAt(i) : '.'; cryptresult[i] = ((byte)c); salt = salt << 6 | 0xFF & A64TOI[c];i--; } while (i >= 0); long rsltblock = des_cipher(constdatablock, salt, 25, KS); cryptresult[12] = ITOA64[((int)rsltblock << 2 & 0x3F)]; rsltblock >>= 4; int i = 12; do { cryptresult[i] = ITOA64[((int)rsltblock & 0x3F)]; rsltblock >>= 6;i--; } while (i >= 2); return new String(cryptresult, 0, 0, 13); } public static void main(String[] arg) { if (arg.length != 2) { System.err.println("Usage - java org.openqa.jetty.util.UnixCrypt <key> <salt>"); System.exit(1); } System.err.println("Crypt=" + crypt(arg[0], arg[1])); } } /* Location: * Qualified Name: org.openqa.jetty.util.UnixCrypt * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.jetty.util; import java.io.UnsupportedEncodingException; import java.util.Iterator; import java.util.Map.Entry; import java.util.Set; import org.apache.commons.logging.Log; import org.openqa.jetty.log.LogFactory; public class UrlEncoded extends MultiMap { private static Log log = LogFactory.getLog(UrlEncoded.class); public UrlEncoded(UrlEncoded url) { super(url); } public UrlEncoded() { super(6); } public UrlEncoded(String s) { super(6); decode(s, StringUtil.__ISO_8859_1); } public UrlEncoded(String s, String charset) { super(6); decode(s, charset); } public void decode(String query) { decodeTo(query, this, StringUtil.__ISO_8859_1); } public void decode(String query, String charset) { decodeTo(query, this, charset); } public String encode() { return encode(StringUtil.__ISO_8859_1, true); } public String encode(String charset) { return encode(charset, true); } public synchronized String encode(String charset, boolean equalsForNullValue) { if (charset == null) { charset = StringUtil.__ISO_8859_1; } StringBuffer result = new StringBuffer(128); synchronized (result) { Iterator iter = entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry)iter.next(); String key = entry.getKey().toString(); Object list = entry.getValue(); int s = LazyList.size(list); if (s == 0) { result.append(encodeString(key, charset)); if (equalsForNullValue) { result.append('='); } } else { for (int i = 0; i < s; i++) { if (i > 0) { result.append('&'); } Object val = LazyList.get(list, i); result.append(encodeString(key, charset)); if (val != null) { String str = val.toString(); if (str.length() > 0) { result.append('='); result.append(encodeString(str, charset)); } else if (equalsForNullValue) { result.append('='); } } else if (equalsForNullValue) { result.append('='); } } } if (iter.hasNext()) { result.append('&'); } } return result.toString(); } } public static void decodeTo(String content, MultiMap map) { decodeTo(content, map, StringUtil.__ISO_8859_1); } public static void decodeTo(String content, MultiMap map, String charset) { if (charset == null) { charset = StringUtil.__ISO_8859_1; } synchronized (map) { String key = null; String value = null; int mark = -1; boolean encoded = false; for (int i = 0; i < content.length(); i++) { char c = content.charAt(i); switch (c) { case '&': value = encoded ? decodeString(content, mark + 1, i - mark - 1, charset) : content.substring(mark + 1, i); mark = i; encoded = false; if (key != null) { map.add(key, value); key = null; } break; case '=': if (key == null) { key = encoded ? decodeString(content, mark + 1, i - mark - 1, charset) : content.substring(mark + 1, i); mark = i; encoded = false; } break; case '+': encoded = true; break; case '%': encoded = true; } } if (key != null) { value = encoded ? decodeString(content, mark + 1, content.length() - mark - 1, charset) : content.substring(mark + 1); map.add(key, value); } else if (mark < content.length()) { key = encoded ? decodeString(content, mark + 1, content.length() - mark - 1, charset) : content.substring(mark + 1); map.add(key, ""); } } } public static void decodeTo(byte[] data, int offset, int length, MultiMap map, String charset) { if ((data == null) || (length == 0)) { return; } if (charset == null) { charset = StringUtil.__ISO_8859_1; } synchronized (map) { try { int ix = offset; int end = offset + length; int ox = offset; String key = null; String value = null; while (ix < end) { byte c = data[(ix++)]; switch ((char)c) { case '&': value = new String(data, offset, ox, charset); if (key != null) { map.add(key, value); key = null; } ox = offset; break; case '=': if (key == null) { key = new String(data, offset, ox, charset); ox = offset; } break; case '+': data[(ox++)] = 32; break; case '%': int i0 = 225; data[(ox++)] = ((byte)((TypeUtil.convertHexDigit(data[(ix++)]) << 4) + TypeUtil.convertHexDigit(data[(ix++)]))); break; default: data[(ox++)] = c; } } if (key != null) { value = new String(data, offset, ox, charset); map.add(key, value); } } catch (UnsupportedEncodingException e) { log.warn("EXCEPTION ", e); } } } public static String decodeString(String encoded) { return decodeString(encoded, 0, encoded.length(), StringUtil.__ISO_8859_1); } public static String decodeString(String encoded, String charset) { return decodeString(encoded, 0, encoded.length(), charset); } public static String decodeString(String encoded, int offset, int length, String charset) { if (charset == null) { charset = StringUtil.__ISO_8859_1; } byte[] bytes = null; int n = 0; for (int i = 0; i < length; i++) { char c = encoded.charAt(offset + i); if ((c < 0) || (c > '�')) { throw new IllegalArgumentException("Not encoded"); } if (c == '+') { if (bytes == null) { bytes = new byte[length * 2]; encoded.getBytes(offset, offset + i, bytes, 0); n = i; } bytes[(n++)] = 32; } else if ((c == '%') && (i + 2 < length)) { char cn = encoded.charAt(offset + i + 1); byte b; byte b; if ((cn >= 'a') && (cn <= 'z')) { b = (byte)('\n' + cn - 97); } else { byte b; if ((cn >= 'A') && (cn <= 'Z')) { b = (byte)('\n' + cn - 65); } else { b = (byte)(cn - '0'); } } cn = encoded.charAt(offset + i + 2); if ((cn >= 'a') && (cn <= 'z')) { b = (byte)(b * 16 + 10 + cn - 97); } else if ((cn >= 'A') && (cn <= 'Z')) { b = (byte)(b * 16 + 10 + cn - 65); } else { b = (byte)(b * 16 + cn - 48); } if (bytes == null) { bytes = new byte[length * 2]; encoded.getBytes(offset, offset + i, bytes, 0); n = i; } i += 2; bytes[(n++)] = b; } else if (n > 0) { bytes[(n++)] = ((byte)c); } } if (bytes == null) { if ((offset == 0) && (encoded.length() == length)) { return encoded; } return encoded.substring(offset, offset + length); } try { return new String(bytes, 0, n, charset); } catch (UnsupportedEncodingException localUnsupportedEncodingException) {} return new String(bytes, 0, n); } public static String encodeString(String string) { return encodeString(string, StringUtil.__ISO_8859_1); } public static String encodeString(String string, String charset) { if (charset == null) { charset = StringUtil.__ISO_8859_1; } byte[] bytes = null; try { bytes = string.getBytes(charset); } catch (UnsupportedEncodingException e) { log.warn("EXCEPTION ", e); bytes = string.getBytes(); } int len = bytes.length; byte[] encoded = new byte[bytes.length * 3]; int n = 0; boolean noEncode = true; for (int i = 0; i < len; i++) { byte b = bytes[i]; if (b == 32) { noEncode = false; encoded[(n++)] = 43; } else if (((b >= 97) && (b <= 122)) || ((b >= 65) && (b <= 90)) || ( (b >= 48) && (b <= 57))) { encoded[(n++)] = b; } else { noEncode = false; encoded[(n++)] = 37; byte nibble = (byte)((b & 0xF0) >> 4); if (nibble >= 10) { encoded[(n++)] = ((byte)(65 + nibble - 10)); } else { encoded[(n++)] = ((byte)(48 + nibble)); } nibble = (byte)(b & 0xF); if (nibble >= 10) { encoded[(n++)] = ((byte)(65 + nibble - 10)); } else { encoded[(n++)] = ((byte)(48 + nibble)); } } } if (noEncode) { return string; } try { return new String(encoded, 0, n, charset); } catch (UnsupportedEncodingException e) { log.warn("EXCEPTION ", e); } return new String(encoded, 0, n); } public Object clone() { return super.clone(); } } /* Location: * Qualified Name: org.openqa.jetty.util.UrlEncoded * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.jetty.util; import java.io.IOException; import java.io.OutputStream; import java.io.Writer; public class WriterOutputStream extends OutputStream { protected Writer _writer; protected String _encoding; private byte[] _buf = new byte[1]; public WriterOutputStream(Writer writer, String encoding) { _writer = writer; _encoding = encoding; } public WriterOutputStream(Writer writer) { _writer = writer; } public void close() throws IOException { _writer.close(); _writer = null; _encoding = null; } public void flush() throws IOException { _writer.flush(); } public void write(byte[] b) throws IOException { if (_encoding == null) { _writer.write(new String(b)); } else { _writer.write(new String(b, _encoding)); } } public void write(byte[] b, int off, int len) throws IOException { if (_encoding == null) { _writer.write(new String(b, off, len)); } else { _writer.write(new String(b, off, len, _encoding)); } } public synchronized void write(int b) throws IOException { _buf[0] = ((byte)b); write(_buf); } } /* Location: * Qualified Name: org.openqa.jetty.util.WriterOutputStream * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.jetty.util.jmx; import javax.management.MBeanException; import org.openqa.jetty.util.LifeCycle; public class LifeCycleMBean extends ModelMBeanImpl { public LifeCycleMBean() throws MBeanException {} public LifeCycleMBean(LifeCycle object) throws MBeanException { super(object); } protected void defineManagedResource() { super.defineManagedResource(); defineAttribute("started"); defineOperation("start", 1); defineOperation("stop", 1); } } /* Location: * Qualified Name: org.openqa.jetty.util.jmx.LifeCycleMBean * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.jetty.util.jmx; import javax.management.MBeanServer; import javax.management.ObjectName; import mx4j.tools.adaptor.http.HttpAdaptor; import org.apache.commons.logging.Log; import org.openqa.jetty.log.LogFactory; public class MX4JHttpAdaptor extends HttpAdaptor { private static Log log = LogFactory.getLog(MX4JHttpAdaptor.class); public MX4JHttpAdaptor() {} public MX4JHttpAdaptor(int port) { super(port); } public MX4JHttpAdaptor(int port, String host) { super(port, host); } public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception { name = super.preRegister(server, name); ObjectName processorName = new ObjectName(name + ",processor=XSLT"); server.createMBean("mx4j.tools.adaptor.http.XSLTProcessor", processorName, null); setProcessorName(processorName); return name; } public void postRegister(Boolean done) { super.postRegister(done); if (done.booleanValue()) { try { start(); } catch (Exception e) { e.printStackTrace(); } log.info("Started MX4J HTTP Adaptor on : " + getPort()); } } } /* Location: * Qualified Name: org.openqa.jetty.util.jmx.MX4JHttpAdaptor * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.jetty.util.jmx; import java.beans.Introspector; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.Locale; import java.util.Map; import java.util.ResourceBundle; import java.util.Set; import javax.management.Attribute; import javax.management.AttributeChangeNotification; import javax.management.AttributeList; import javax.management.AttributeNotFoundException; import javax.management.InstanceNotFoundException; import javax.management.InvalidAttributeValueException; import javax.management.ListenerNotFoundException; import javax.management.MBeanException; import javax.management.MBeanInfo; import javax.management.MBeanNotificationInfo; import javax.management.MBeanParameterInfo; import javax.management.MBeanRegistration; import javax.management.MBeanServer; import javax.management.Notification; import javax.management.NotificationFilter; import javax.management.NotificationListener; import javax.management.ObjectInstance; import javax.management.ObjectName; import javax.management.ReflectionException; import javax.management.RuntimeOperationsException; import javax.management.modelmbean.InvalidTargetObjectTypeException; import javax.management.modelmbean.ModelMBean; import javax.management.modelmbean.ModelMBeanAttributeInfo; import javax.management.modelmbean.ModelMBeanInfo; import javax.management.modelmbean.ModelMBeanInfoSupport; import javax.management.modelmbean.ModelMBeanNotificationInfo; import javax.management.modelmbean.ModelMBeanOperationInfo; import org.apache.commons.logging.Log; import org.openqa.jetty.log.LogFactory; import org.openqa.jetty.util.LogSupport; import org.openqa.jetty.util.TypeUtil; public class ModelMBeanImpl implements ModelMBean, MBeanRegistration { private static Log log = LogFactory.getLog(ModelMBeanImpl.class); public static final int IMPACT_ACTION = 1; public static final int IMPACT_ACTION_INFO = 2; public static final int IMPACT_INFO = 0; public static final int IMPACT_UNKOWN = 3; public static final String STRING = "java.lang.String"; public static final String OBJECT = "java.lang.Object"; public static final String INT = "int"; public static final String[] NO_PARAMS = new String[0]; public static final boolean READ_WRITE = true; public static final boolean READ_ONLY = false; public static final boolean ON_MBEAN = true; public static final boolean ON_OBJECT = false; private static HashMap __objectId = new HashMap(); private static String __defaultDomain = "org.openqa.jetty"; protected ModelMBeanInfoSupport _beanInfo; private MBeanServer _mBeanServer; private Object _object; private ObjectName _objectName; private boolean _dirty = false; private HashMap _getter = new HashMap(4); private HashMap _setter = new HashMap(4); private HashMap _method = new HashMap(4); private ArrayList _attributes = new ArrayList(4); private ArrayList _operations = new ArrayList(4); private ArrayList _notifications = new ArrayList(4); private String _baseObjectName = null; private Map _components = new HashMap(4); public static ModelMBean mbeanFor(Object o) { try { Class oClass = o.getClass(); ClassLoader loader = oClass.getClassLoader(); ModelMBean mbean = null; boolean jmx = false; Class[] interfaces = null; int i = 0; do { Class focus = interfaces == null ? oClass : interfaces[i]; String pName = focus.getPackage().getName(); String cName = focus.getName().substring(pName.length() + 1); String mName = pName + (jmx ? ".jmx." : ".") + cName + "MBean"; try { Class mClass = loader.loadClass(mName); if (log.isTraceEnabled()) { log.trace("mbeanFor " + o + " mClass=" + mClass); } mbean = (ModelMBean)mClass.newInstance(); mbean.setManagedResource(o, "objectReference"); if (log.isDebugEnabled()) { log.debug("mbeanFor " + o + " is " + mbean); } return mbean; } catch (ClassNotFoundException e) { if (e.toString().endsWith("MBean")) { if (log.isTraceEnabled()) { log.trace(e.toString()); } } else { log.warn("EXCEPTION ", e); } } catch (Error e) { log.warn("EXCEPTION ", e); mbean = null; } catch (Exception e) { log.warn("EXCEPTION ", e); mbean = null; } if (jmx) { if (interfaces != null) { i++; if (i >= interfaces.length) { interfaces = null; oClass = oClass.getSuperclass(); } } else { interfaces = oClass.getInterfaces(); i = 0; if ((interfaces == null) || (interfaces.length == 0)) { interfaces = null; Further reading...For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.New!JAR listings
|