Package sun.misc

Examples of sun.misc.BASE64Decoder


        return new HexBinary(s);
    }

    public static byte[] convertTobase64Binary(String s) throws Exception{
        //using the Sun's base64 decoder that should come with the JRE
        return new BASE64Decoder().decodeBuffer(s);
    }
View Full Code Here


  private BASE64Encoder  encoder;

  public SunBase64Encoder() {
    super();
    this.decoder = new BASE64Decoder();
    this.encoder = new BASE64Encoder();
  }
View Full Code Here

     
      String mimeType = MimeUtils.getMimeType(templateFileName);
      logger.debug("Mime type is = " + mimeType);
      response.setContentType(mimeType);

      BASE64Decoder bASE64Decoder = new BASE64Decoder();
      byte[] templateContent = bASE64Decoder.decodeBuffer(template.getContent());
      response.setContentLength(templateContent.length);
      response.getOutputStream().write(templateContent);
      response.getOutputStream().flush()
      response.getOutputStream().close();
     
View Full Code Here

      }else{
        Content templateContent = contentProxy.readTemplate(documentId,new HashMap());
 
        byte[] byteContent = null;
        try {
          BASE64Decoder bASE64Decoder = new BASE64Decoder();
          byteContent = bASE64Decoder.decodeBuffer(templateContent.getContent());
          String xmlSourceBean = new String(byteContent);
          SourceBean sb =SourceBean.fromXMLString(xmlSourceBean);
          template = new JPaloEngineTemplate(sb);   
         
          if(template == null){
View Full Code Here

          requestParameters.put("SBI_READ_ONLY_TEMPLATE", "true");
          Content template = contentServiceProxy.readTemplate(subreportMeta.getDocumentId(), requestParameters);
          template.getFileName();
          logger.debug("Read the template.(subreport)"+template.getFileName());
          InputStream is = null;   
          BASE64Decoder bASE64Decoder = new BASE64Decoder();
          byte[] templateContent = bASE64Decoder.decodeBuffer(template.getContent());
          is = new java.io.ByteArrayInputStream(templateContent);
          String str = new String(templateContent);
   
          SpagoBIAccessUtils util = new SpagoBIAccessUtils();
   
View Full Code Here

      // the possible values of the visibility are (Private/Public)
      analysisBean.setAnalysisVisibility(visSO);
      // get content from cms
     
      String subobjdata64Coded = request.getParameter("subobjectdata");
      BASE64Decoder bASE64Decoder = new BASE64Decoder();
      byte[] subobjBytes = bASE64Decoder.decodeBuffer(subobjdata64Coded);
      is = new java.io.ByteArrayInputStream(subobjBytes);
      InputStreamReader isr = new InputStreamReader(is);
      XStream dataBinder = new XStream();
      try {
        analysis = (AnalysisBean) dataBinder.fromXML(isr, new AnalysisBean());
        isr.close();
        query = analysis.getMdxQuery();
        nameConnection = analysis.getConnectionName();
        reference = analysis.getCatalogUri();
      } catch (Throwable t) {
        t.printStackTrace();
      }
   
    // normal execution (no subObject) 
    } else {
      String templateBase64Coded = request.getParameter("template");
      BASE64Decoder bASE64Decoder = new BASE64Decoder();
      byte[] template = bASE64Decoder.decodeBuffer(templateBase64Coded);
      is = new java.io.ByteArrayInputStream(template);
      org.dom4j.io.SAXReader reader = new org.dom4j.io.SAXReader();
        Document document = reader.read(is);
        nameConnection = request.getParameter("connectionName");
      query = document.selectSingleNode("//olap/MDXquery").getStringValue();
View Full Code Here

    }

    private String publishTemplate(String user, HashMap attributes) {
  logger.debug("IN");
  BASE64Decoder decoder = new BASE64Decoder();
  String encodedTemplate = (String) attributes.get("TEMPLATE");
  byte[] buffer = null;
  try {

      buffer = decoder.decodeBuffer(encodedTemplate);
      String template = new String(buffer);
      attributes.put("TEMPLATE", template);
      String label = (String) attributes.get("LABEL");
      BIObject obj = DAOFactory.getBIObjectDAO().loadBIObjectByLabel(label);
      if (obj == null) {
View Full Code Here

*/
public class ClientSideFlowStateStorage extends AbstractFlowStateStorage
{
    protected byte[] getSerializedState(HttpServletRequest request, String id) throws IOException
    {
        return new BASE64Decoder().decodeBuffer(id);
    }
View Full Code Here

    in.close();

    Cipher cipher = Cipher.getInstance("DES/ECB/PKCS5Padding");
    cipher.init(Cipher.DECRYPT_MODE, key);

    BASE64Decoder decoder = new BASE64Decoder();

    byte[] inputBytes = decoder.decodeBuffer(toDecrypt);
    byte[] outputBytes = cipher.doFinal(inputBytes);

    String result = new String(outputBytes, "UTF8");
    return result;
  }
View Full Code Here

          "encrypted string was null or empty");

    try {
      SecretKey key = keyFactory.generateSecret(keySpec);
      cipher.init(Cipher.DECRYPT_MODE, key);
      BASE64Decoder base64decoder = new BASE64Decoder();
      byte[] cleartext = base64decoder.decodeBuffer(encryptedString);
      byte[] ciphertext = cipher.doFinal(cleartext);

      return bytes2String(ciphertext);
    } catch (Exception e) {
      throw new EncryptionException(e);
View Full Code Here

TOP

Related Classes of sun.misc.BASE64Decoder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.