Examples of ByteArrayResource


Examples of org.springframework.core.io.ByteArrayResource

      if (resourceLoader != null) {
        res = resourceLoader.getResource(script);
      }
    }
    else {
      res = new ByteArrayResource(script.getBytes());
    }

    return executeScript(new PigScript(res, arguments));
  }
View Full Code Here

Examples of org.springframework.core.io.ByteArrayResource

    return doCallFilter(recorderdResponse, new MockHttpServletResponse());
  }

  private MockFilterChain doCallFilter(VerifyTokenResponse recorderdResponse, MockHttpServletResponse response)
      throws IOException, ServletException {
    return doCallFilter(new Resource[] { new ByteArrayResource(mapper.writeValueAsString(recorderdResponse)
        .getBytes(), "json") }, response);
  }
View Full Code Here

Examples of org.springframework.core.io.ByteArrayResource

    mailSender.setPort(this.wiserPort);

    final MimeMessage message = mailSender.createMimeMessage();
    final String pictureName = "picture.png";

    final ByteArrayResource byteArrayResource = getFileData(pictureName);

    try {

      final MimeMessageHelper helper = new MimeMessageHelper(message, true);
View Full Code Here

Examples of org.springframework.core.io.ByteArrayResource

      messageHelper.setSubject("Parsing of Attachments");
      messageHelper.setText("Spring Integration Rocks!", "Spring Integration <b>Rocks</b>!");

      final String pictureName = "picture.png";

      final ByteArrayResource byteArrayResource = getFileData(pictureName);

      messageHelper.addInline("picture12345", byteArrayResource, "image/png");

    }
    catch (MessagingException e) {
View Full Code Here

Examples of org.springframework.core.io.ByteArrayResource

    final InputStream attachmentInputStream = MimeMessageParsingTest.class.getResourceAsStream(filename);

    Assert.assertNotNull("Resource not found: " + filename, attachmentInputStream);

    ByteArrayResource byteArrayResource = null;

    try {
      byteArrayResource = new ByteArrayResource(IOUtils.toByteArray(attachmentInputStream));
      attachmentInputStream.close();
    }
    catch (IOException e1) {
      Assert.fail();
    }
View Full Code Here

Examples of org.springframework.core.io.ByteArrayResource

        return new FileSystemResource(file);
    }

    @Converter
    public static ByteArrayResource toResource(byte[] data) throws IOException {
        return new ByteArrayResource(data);
    }
View Full Code Here

Examples of org.springframework.core.io.ByteArrayResource

        return new FileSystemResource(file);
    }

    @Converter
    public static ByteArrayResource toResource(byte[] data) throws IOException {
        return new ByteArrayResource(data);
    }
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.