public static String getReason(int code) { Buffer reason=(code<__reasons.length)?__reasons[code]:null; return reason==null?TypeUtil.toString(code):reason.toString(); }
/** Add Error Page mapping for a status code. * This method is called as a result of an error-code element in a web.xml file * or may be called directly * @param code The HTTP status code to match * @param uri The URI of the error page. */ public void addErrorPage(int code,String uri) { if (_errorPages==null) _errorPages=new HashMap(); _errorPages.put(TypeUtil.toString(code),uri); }
public static String digest(String password) { try { byte[] digest; synchronized(__md5Lock) { if (__md==null) { try{__md = MessageDigest.getInstance("MD5");} catch (Exception e ) {Log.warn(e);return null;} } __md.reset(); __md.update(password.getBytes(StringUtil.__ISO_8859_1)); digest=__md.digest(); } return __TYPE+TypeUtil.toString(digest,16); } catch (Exception e) { Log.warn(e); return null; } } }
public static String digest(String password) { try { byte[] digest; synchronized(__md5Lock) { if (__md==null) { try{__md = MessageDigest.getInstance("MD5");} catch (Exception e ) {Log.warn(e);return null;} } __md.reset(); __md.update(password.getBytes(StringUtil.__ISO_8859_1)); digest=__md.digest(); } return __TYPE+TypeUtil.toString(digest,16); } catch (Exception e) { Log.warn(e); return null; } } }
md.update(TypeUtil.toString(ha1,16).getBytes(StringUtil.__ISO_8859_1)); md.update((byte)':'); md.update(nonce.getBytes(StringUtil.__ISO_8859_1)); md.update(qop.getBytes(StringUtil.__ISO_8859_1)); md.update((byte)':'); md.update(TypeUtil.toString(ha2,16).getBytes(StringUtil.__ISO_8859_1)); byte[] digest=md.digest(); return (TypeUtil.toString(digest,16).equalsIgnoreCase(response));
md.update(TypeUtil.toString(ha1,16).getBytes(StringUtil.__ISO_8859_1)); md.update((byte)':'); md.update(nonce.getBytes(StringUtil.__ISO_8859_1)); md.update(qop.getBytes(StringUtil.__ISO_8859_1)); md.update((byte)':'); md.update(TypeUtil.toString(ha2,16).getBytes(StringUtil.__ISO_8859_1)); byte[] digest=md.digest(); return (TypeUtil.toString(digest,16).equalsIgnoreCase(response));
if (code!=null) error_page= (String)_errorPages.get(TypeUtil.toString(code.intValue()));
response.setHeader(HttpHeaders.CONTENT_LENGTH,TypeUtil.toString(length));
_writer.write(TypeUtil.toString(System.currentTimeMillis() - request.getTimeStamp()));
response.setContentLength((int)count); else response.setHeader(HttpHeaders.CONTENT_LENGTH,TypeUtil.toString(count));