/** * Decodes a byte[] containing containing characters in the Base64 alphabet. * * @param pArray * A byte array containing Base64 character data * @return a byte array containing binary data */ public byte[] decode(byte[] pArray) { return decodeBase64(pArray); }
/** * Decodes a byte[] containing containing characters in the Base64 alphabet. * * @param pArray * A byte array containing Base64 character data * @return a byte array containing binary data */ public byte[] decode(byte[] pArray) { return decodeBase64(pArray); }
/** * Decodes a byte64-encoded integer according to crypto standards such as W3C's XML-Signature * * @param pArray * a byte array containing base64 character data * @return A BigInteger * @since 1.4 */ public static BigInteger decodeInteger(final byte[] pArray) { return new BigInteger(1, decodeBase64(pArray)); }
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String fileName = URLDecoder.decode(request.getHeader("File-Name"), Charsets.UTF_8.name()); AttachmentSupport attachmentSuppport = (AttachmentSupport) SerializationUtils .deserialize(Base64.decodeBase64(request.getHeader("Attachment-Support"))); try { String attachmentName = attachmentSuppport.saveAttachment(fileName, request.getInputStream()); response.getWriter().print(URLEncoder.encode(attachmentName, Charsets.UTF_8.name())); response.setStatus(HttpServletResponse.SC_OK); } catch (Exception e) { logger.error("Error uploading attachment.", e); if (e.getMessage() != null) response.getWriter().print(e.getMessage()); else response.getWriter().print("Internal server error"); response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } }
@Override public void onBeginRequest(RequestCycle cycle) { WebRequest request = (WebRequest) cycle.getRequest(); String authorization = request.getHeader(AUTHORIZATION_HEADER); if(authorization!=null && authorization.startsWith("Basic")) { String[] pair = new String(Base64.decodeBase64(authorization.substring(6))).split(":"); if (pair.length == 2) { String userName = pair[0]; String password = pair[1]; OrientDbWebSession session = OrientDbWebSession.get(); if(!session.signIn(userName, password)) { cycle.setMetaData(LAZY_AUTHORIZED, false); } } } }
String windowId = new String(Base64.decodeBase64(pathInfo.substring(SHARED_RESOURCE_URL_PORTLET_WINDOW_ID_PREFIX.length(), nextSeparator)));
return false; byte[] decoded = Base64.decodeBase64(param.getBytes()); String[] split = new String(decoded).split(":"); if (split == null || split.length != 2)
return false; byte[] decoded = Base64.decodeBase64(param.getBytes()); String[] split = new String(decoded).split(":"); if (split == null || split.length != 2)