Package org.springframework.core.io

Examples of org.springframework.core.io.ByteArrayResource


            + "\">"
            + config
            + "</server>";

        XmlBeanFactory factory = new XmlBeanFactory(
                new ByteArrayResource(completeConfig.getBytes()));
       
        return (FtpServer) factory.getBean("server");

    }
View Full Code Here


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

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

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

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

    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

    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

      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

    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

        return new FileSystemResource(file);
    }

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

        return new FileSystemResource(file);
    }

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

        template.sendSourceAndReceiveToResult(request, new StringResult());
    }

    @Test
    public void xsdMatch() throws Exception {
        Resource schema = new ByteArrayResource(
                "<schema xmlns=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"http://example.com\" elementFormDefault=\"qualified\"><element name=\"request\"/></schema>".getBytes());

        server.expect(validPayload(schema));

        StringResult result = new StringResult();
View Full Code Here

TOP

Related Classes of org.springframework.core.io.ByteArrayResource

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.