Examples of Body


Examples of org.apache.camel.Body

            return ExpressionBuilder.propertyExpression(propertyAnnotation.name());
        } else if (annotation instanceof Header) {
            Header headerAnnotation = (Header)annotation;
            return ExpressionBuilder.headerExpression(headerAnnotation.name());
        } else if (annotation instanceof Body) {
            Body content = (Body)annotation;
            return ExpressionBuilder.bodyExpression(parameterType);

            // TODO allow annotations to be used to create expressions?
            /*
             * } else if (annotation instanceof XPath) { XPath xpathAnnotation =
View Full Code Here

Examples of org.apache.ecs.html.Body

     */
    public Email setMsg(String msg)
            throws MessagingException
    {
        setTextMsg(msg);
        setHtmlMsg(new ElementContainer(new Html(new Body()
                .addElement(new PRE(msg)))).toString());
        return this;
    }
View Full Code Here

Examples of org.apache.james.mime4j.dom.Body

                if (!attachmentFilter.isEligible(att)) {
                    continue;
                }
                final Map<String, Object> attProps = new HashMap<String, Object>();
                parseHeaderToProps(att.getHeader(), attProps);
                Body body = att.getBody();
                if (body instanceof BinaryBody) {
                    attProps.put(CONTENT, ((BinaryBody) body).getInputStream());
                } else if (body instanceof TextBody) {
                    attProps.put(CONTENT, ((TextBody) body).getInputStream());
                }
View Full Code Here

Examples of org.apache.james.mime4j.dom.Body

        if (eligibleExtensions != null && !eligibleExtensions.contains(ext)) {
            return false;
        }
       
        // size check
        final Body body = attachment.getBody();
        try {
            if (
                    body instanceof BinaryBody
                    && IOUtils.toByteArray(((BinaryBody) body).getInputStream()).length > maxSize
                    ||
View Full Code Here

Examples of org.apache.james.mime4j.dom.Body

     */
    private static BodyPart createRandomBinaryAttachment(int numberOfBytes) throws IOException {
        byte[] data = new byte[numberOfBytes];
        new Random().nextBytes(data);

        Body body = new StorageBodyFactory().binaryBody(new ByteArrayInputStream(data));

        BodyPart bodyPart = new BodyPart();
        bodyPart.setContentDisposition("attachment", "file"+Math.random());
        bodyPart.setBody(body, "application/octet-stream");

View Full Code Here

Examples of org.apache.james.mime4j.message.Body

         return getBody(type.getType(), type.getGenericType());
      }

      public InputStream getBody() throws IOException
      {
         Body body = bodyPart.getBody();
         InputStream result = null;
         if (body instanceof TextBody)
         {
            Reader reader = ((TextBody) body).getReader();
            result = new ReaderBackedInputStream(reader);
View Full Code Here

Examples of org.apache.james.mime4j.message.Body

         return result;
      }

      public String getBodyAsString() throws IOException
      {
         Body body = bodyPart.getBody();
         String result = null;
         if (body instanceof TextBody)
         {
            Reader reader = ((TextBody) body).getReader();
            try
View Full Code Here

Examples of org.apache.james.mime4j.message.Body

        List<?> bodyParts = getBodyParts();

        long contentLen = 0;
        for (int i = 0; i < bodyParts.size(); i++) {
            BodyPart part = (BodyPart) bodyParts.get(i);
            Body body = part.getBody();
            if (body instanceof ContentBody) {
                long len = ((ContentBody) body).getContentLength();
                if (len >= 0) {
                    contentLen += len;
                } else {
View Full Code Here

Examples of org.apache.maven.doxia.site.decoration.Body

     *             An error occurred while creating the report.
     */
    public void execute() throws MojoExecutionException, MojoFailureException
    {
        DecorationModel model = new DecorationModel();
        model.setBody( new Body() );
        Map<String, String> attributes = new HashMap<String, String>();
        attributes.put( "outputEncoding", "UTF-8" );
        Locale locale = Locale.getDefault();
        try
        {
View Full Code Here

Examples of org.apache.maven.plugins.changes.model.Body

                }
                this.title = properties.getTitle();
            }


            Body body = changesDocument.getBody();


            if ( body != null )
            {
                this.releaseList = body.getReleases();
            }

        }
        catch ( Throwable e )
        {
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.