Package org.apache.wicket.request.resource

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


  public void respond(IRequestCycle requestCycle)
  {
    Attributes attributes = new Attributes(requestCycle.getRequest(),
      requestCycle.getResponse());

    ResourceStreamResource resource = new ResourceStreamResource(resourceStream);

    configure(resource);

    resource.respond(attributes);
  }
View Full Code Here


   *      The data exporter to use to export the data.
   * @return a new link to the exported data for the provided {@link IDataExporter}.
   */
  protected Component createExportLink(String componentId, final IDataExporter dataExporter)
  {
    IResource resource = new ResourceStreamResource()
    {
      @Override
      protected IResourceStream getResourceStream()
      {
        return new DataExportResourceStreamWriter(dataExporter, getTable());
View Full Code Here

    assertEquals(TEST_STRING.length(), tester.getContentLengthFromResponseHeader());
  }

  private void bindToApplicationAsResourceAndRequestIt(IResourceStream iResourceStream)
  {
    IResource resource = new ResourceStreamResource(iResourceStream);
    tester.getApplication().getSharedResources().add("resource", resource);
    tester.getRequest().setUrl(
      tester.getRequestCycle().mapUrlFor(
        tester.getApplication()
          .getSharedResources()
View Full Code Here

  @Test
  public void giveUpRespondingOnIOExceptions()
  {
    TestRequestCycleListener testRequestCycleListener = new TestRequestCycleListener();
    tester.getApplication().getRequestCycleListeners().add(testRequestCycleListener);
    tester.startResource(new ResourceStreamResource(new StringResourceStream("asdf")));
    assertThat(testRequestCycleListener.lastExceptionRquestHandlerResolved,
      instanceOf(EmptyRequestHandler.class));
  }
View Full Code Here

    StringResourceStream resourceStream = new StringResourceStream(stringValue,
      textTemplate.getContentType());
    resourceStream.setLastModified(textTemplate.lastModifiedTime());

    resource = new ResourceStreamResource(resourceStream);
    return resource;
  }
View Full Code Here

    StringResourceStream resourceStream = new StringResourceStream(stringValue,
      textTemplate.getContentType());
    resourceStream.setLastModified(textTemplate.lastModifiedTime());

    resource = new ResourceStreamResource(resourceStream);
    return resource;
  }
View Full Code Here

  public void respond(IRequestCycle requestCycle)
  {
    Attributes attributes = new Attributes(requestCycle.getRequest(),
      requestCycle.getResponse());

    ResourceStreamResource resource = new ResourceStreamResource(resourceStream);
    resource.setFileName(fileName);
    resource.setContentDisposition(contentDisposition);
    resource.respond(attributes);
  }
View Full Code Here

    assertEquals(TEST_STRING.length(), tester.getContentLengthFromResponseHeader());
  }

  private void bindToApplicationAsResourceAndRequestIt(IResourceStream iResourceStream)
  {
    IResource resource = new ResourceStreamResource(iResourceStream);
    tester.getApplication().getSharedResources().add("resource", resource);
    tester.getRequest().setUrl(
      tester.getRequestCycle().mapUrlFor(
        tester.getApplication()
          .getSharedResources()
View Full Code Here

        final Clob blob = new Clob(clientFileName, contentType, str);
        return blob;
    }

    protected IResource newResource(final Clob clob) {
        return new ResourceStreamResource(new StringResourceStream(clob.getChars(), clob.getMimeType().getBaseType()));
    }
View Full Code Here

  public void respond(IRequestCycle requestCycle)
  {
    Attributes attributes = new Attributes(requestCycle.getRequest(),
      requestCycle.getResponse());

    ResourceStreamResource resource = new ResourceStreamResource(resourceStream);

    configure(resource);

    resource.respond(attributes);
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.request.resource.ResourceStreamResource

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.