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);
    resource.setFileName(fileName);
    resource.setContentDisposition(contentDisposition);
    resource.respond(attributes);
  }
View Full Code Here


                }
                public Bytes length() {
                  return Bytes.bytes(new FileSummary(FishEye.getInstance().getAnalyzer(), fid).getSize());
                }
              };
            ResourceStreamResource resourceStream = new ResourceStreamResource(hadoopfsStream);
            resourceStream.setContentDisposition(ContentDisposition.ATTACHMENT);
            resourceStream.setFileName(fs.getFname());
            add(new ResourceLink<File>("downloadlink", resourceStream));

            // querySupported container holds queryform
            // queryUnsupported container holds an error message
            final boolean querySupported = dd.isHiveSupported() && fe.isQueryServerAvailable(false);
View Full Code Here

      else
      {
        parser.parse(tableComponent);
      }
      XlsStream xlsStream = new XlsStream(parser.getSheet().getWorkbook());
      ResourceStreamResource resource = new ResourceStreamResource(xlsStream);
      resource.setFileName(filename);
      resource.setContentDisposition(ContentDisposition.ATTACHMENT);
      IResource.Attributes a = new IResource.Attributes(requestCycle.getRequest(),
        requestCycle.getResponse());
      resource.respond(a);
    }
    catch (Exception e)
    {
      throw new RuntimeException("Error while generating a xls file to table component", e);
    }
View Full Code Here

  }

  public void testXlsStream()
  {
    Sheet sheet = new HSSFWorkbook().createSheet();
    tester.startResource(new ResourceStreamResource(new XlsStream(sheet.getWorkbook())));
    assertTrue(tester.getLastResponse().getContentType().contains("excel"));
  }
View Full Code Here

        {
          parser.parse(tableComponent);
        }
      }
      XlsStream xlsStream = new XlsStream( workbook );
      ResourceStreamResource resource = new ResourceStreamResource(xlsStream);
      resource.setFileName(filename);
      resource.setContentDisposition(ContentDisposition.ATTACHMENT);
      IResource.Attributes a = new IResource.Attributes(requestCycle.getRequest(),
        requestCycle.getResponse());
      resource.respond(a);
    }
    catch (Exception e)
    {
      throw new RuntimeException("Error while generating a xls file to table component", e);
    }
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

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.