Examples of ByteArrayResource


Examples of com.alibaba.citrus.service.resource.support.ByteArrayResource

            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            Result result = new StreamResult(baos);

            transformer.transform(source, result);

            return new ByteArrayResource(baos.toByteArray());
        } catch (Exception e) {
            throw new ResourceNotFoundException("Could not apply XSLT \"" + xsltResName + "\" to resource \""
                    + xmlResName + "\"", e);
        }
    }
View Full Code Here

Examples of com.icesoft.faces.context.ByteArrayResource

      context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, getMessage("enroll.keystore.couldnotcreate"), null));
      log.info("KeyStore request for '" + username + "' failed. " + keyStoreResponse.getErrorMessage());
      return;
    }
    // Handle response
    resource = new ByteArrayResource(keyStoreResponse.getResponseData());
    switch (keyStoreResponse.getResponseType()) {
    case SecConst.TOKEN_SOFT_JKS:
      filename = username + ".jks";
      break;
    case SecConst.TOKEN_SOFT_P12:
View Full Code Here

Examples of com.intel.mtwilson.io.ByteArrayResource

        tlsKeystoreResource = null;
    }

    public Resource getTlsKeystoreResource() {
        if( tlsKeystoreResource == null ) {
            tlsKeystoreResource = new ByteArrayResource(tlsKeystore) {
                @Override
                protected void onClose() {
                    tlsKeystore = array; // array is a protected member of ByteArrayResource
                }
            };
View Full Code Here

Examples of com.redhat.ceylon.compiler.java.language.ByteArrayResource

            RuntimeModelLoader modelLoader = moduleManager.getModelLoader();
            if (modelLoader != null) {
                byte[] contents = modelLoader.getContents(declaration, fullPath);
                if (contents != null) {
                    URI uri = modelLoader.getContentUri(declaration, fullPath);
                    return new ByteArrayResource(contents, uri);
                }
            }
        }
       
        // Second let's see if we can find the on-disk location of the module
View Full Code Here

Examples of org.apache.wicket.request.resource.ByteArrayResource

  @Test
  public void clickResourceLinkWithResource()
  {
    MockPageWithLink page = new MockPageWithLink();
    String content = "content";
    ByteArrayResource resource = new ByteArrayResource("text/plain", content.getBytes(),
      "fileName.txt");
    ResourceLink<Void> link = new ResourceLink<Void>(MockPageWithLink.LINK_ID, resource);
    page.add(link);
    tester.startPage(page);
    tester.clickLink(MockPageWithLink.LINK_ID, false);
View Full Code Here

Examples of org.apache.wicket.request.resource.ByteArrayResource

  @Test
  public void clickResourceLinkWithResourceReference()
  {
    MockPageWithLink page = new MockPageWithLink();
    String content = "content";
    final ByteArrayResource resource = new ByteArrayResource("text/plain", content.getBytes(),
        "fileName.txt");
    ResourceReference reference = new ResourceReference(WicketTesterTest.class, "resourceLinkWithResourceReferenceTest")
    {
      @Override
      public IResource getResource()
View Full Code Here

Examples of org.apache.wicket.request.resource.ByteArrayResource

   */
  @Test
  public void resource()
  {
    ImageStatelessPage page = new ImageStatelessPage();
    final Image i = new Image("test", new ByteArrayResource("text/text", new byte[0]));
    page.add(i);
    tester.startPage(page);
    assertTrue("image with resource should be stateful", !i.isStateless());
  }
View Full Code Here

Examples of org.apache.wicket.request.resource.ByteArrayResource

  @Test
  public void clickResourceLink()
  {
    MockPageWithLink page = new MockPageWithLink();
    String content = "content";
    ByteArrayResource resource = new ByteArrayResource("text/plain", content.getBytes(), "fileName.txt");
    ResourceLink<Void> link = new ResourceLink<Void>(MockPageWithLink.LINK_ID, resource);
    page.add(link);
    tester.startPage(page);
    tester.clickLink(MockPageWithLink.LINK_ID, false);
    assertEquals(tester.getContentTypeFromResponseHeader(), "text/plain");
View Full Code Here

Examples of org.apache.wicket.request.resource.ByteArrayResource

   * @throws Exception
   */
  @Test
  public void urlForDynamicResource() throws Exception
  {
    ByteArrayResource resource = new ByteArrayResource(null, new byte[] {1, 2}, "test.bin");
    ResourceRequestHandler handler = new ResourceRequestHandler(resource, new PageParameters());
    CharSequence url = requestCycle.urlFor(handler);
    assertEquals(RESOURCE_URL + JSESSIONID, url);
  }
View Full Code Here

Examples of org.apache.wicket.request.resource.ByteArrayResource

  @Test
  public void clickResourceLinkWithResource()
  {
    MockPageWithLink page = new MockPageWithLink();
    String content = "content";
    ByteArrayResource resource = new ByteArrayResource("text/plain", content.getBytes(),
      "fileName.txt");
    ResourceLink<Void> link = new ResourceLink<Void>(MockPageWithLink.LINK_ID, resource);
    page.add(link);
    tester.startPage(page);
    tester.clickLink(MockPageWithLink.LINK_ID, false);
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.