Package javax.activation

Examples of javax.activation.DataHandler.writeTo()


    Base64Binary binaryData = attachmentRequest.getBinaryData();
    DataHandler dataHandler = binaryData.getBase64Binary();
    File file = new File(
        attachmentRequest.getFileName());
    FileOutputStream fileOutputStream = new FileOutputStream(file);
    dataHandler.writeTo(fileOutputStream);
    fileOutputStream.flush();
    fileOutputStream.close();
   
    AttachmentResponse response = new AttachmentResponse();
    response.setAttachmentResponse("File saved succesfully.");
View Full Code Here


                    tempDirectory + File.separator +
                    (System.currentTimeMillis() + new Random().nextDouble());
            new File(tempDir).mkdirs();
            serviceArchive = new File(tempDir + File.separator + serviceGroupName);
            FileOutputStream out = new FileOutputStream(serviceArchive);
            dh.writeTo(out);
            out.close();
        } else {
            serviceArchive = new File(axis2Repo + File.separator + "services" +
                                      File.separator + serviceGroupName);
        }
View Full Code Here

        Attachments attachment = msgCtx.getAttachmentMap();
        DataHandler dataHandler = attachment.getDataHandler(attchmentID);
        File file = new File(
        name);
    FileOutputStream fileOutputStream = new FileOutputStream(file);
    dataHandler.writeTo(fileOutputStream);
    fileOutputStream.flush();
    fileOutputStream.close();
   
    return "File saved succesfully.";
  }
View Full Code Here

                    tempDirectory + File.separator +
                    (System.currentTimeMillis() + new Random().nextDouble());
            new File(tempDir).mkdirs();
            serviceArchive = new File(tempDir + File.separator + serviceGroupName);
            FileOutputStream out = new FileOutputStream(serviceArchive);
            dh.writeTo(out);
            out.close();
        } else {
            serviceArchive = new File(axis2Repo + File.separator + "services" +
                                      File.separator + serviceGroupName);
        }
View Full Code Here

                handler.setCommandMap(AttachmentUtil.getCommandMap());
               
                writeHeaders(handler.getContentType(), a.getId(),
                             headers, writer);
                out.write(writer.getBuffer().toString().getBytes(encoding));
                handler.writeTo(out);
            }
        }
        StringWriter writer = new StringWriter();               
        writer.write("\r\n");
        writer.write("--");
View Full Code Here

                handler.setCommandMap(AttachmentUtil.getCommandMap());
               
                writeHeaders(handler.getContentType(), a.getId(),
                             headers, writer);
                out.write(writer.getBuffer().toString().getBytes(encoding));
                handler.writeTo(out);
            }
        }
        StringWriter writer = new StringWriter();               
        writer.write("\r\n");
        writer.write("--");
View Full Code Here

                handler.setCommandMap(AttachmentUtil.getCommandMap());
               
                writeHeaders(handler.getContentType(), a.getId(),
                             headers, writer);
                out.write(writer.getBuffer().toString().getBytes(encoding));
                handler.writeTo(out);
            }
        }
        StringWriter writer = new StringWriter();               
        writer.write("\r\n");
        writer.write("--");
View Full Code Here

    {
        DataHandler dataHandler = mimeMessage.getDataHandler();
        ByteArrayOutputStream byteArrayOutStream = new ByteArrayOutputStream();
        BufferedOutputStream buffOs = new BufferedOutputStream(
                byteArrayOutStream);
        dataHandler.writeTo(buffOs);
        buffOs.flush();

        return byteArrayOutStream.toByteArray();
    }
View Full Code Here

                handler.setCommandMap(AttachmentUtil.getCommandMap());
               
                writeHeaders(handler.getContentType(), a.getId(),
                             headers, writer);
                out.write(writer.getBuffer().toString().getBytes(encoding));
                handler.writeTo(out);
            }
        }
        StringWriter writer = new StringWriter();               
        writer.write("\r\n");
        writer.write("--");
View Full Code Here

                     }

                     if (href != null) {
                         DataHandler binaryDataHandler = msgCtx.getAttachment(href.substring(4));
                         ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
                         binaryDataHandler.writeTo(outputStream);
                         value = new String(outputStream.toByteArray());
                     }
                }
                else {
                     value = bodyNode.getText();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.