Package com.iisigroup.cap.response

Examples of com.iisigroup.cap.response.ByteArrayDownloadResult


    // String outputName = request.get("fileName", "CapLog.log");
    File file = new File("logs/CapLog.log");
    FileInputStream is = null;
    try {
      is = FileUtils.openInputStream(file);
      return new ByteArrayDownloadResult(request,
          IOUtils.toByteArray(is), "text/plain");
    } catch (IOException e) {
      logger.error(e.getMessage(), e);
    } finally {
      IOUtils.closeQuietly(is);
View Full Code Here


  @HandlerType(HandlerTypeEnum.FileDownload)
  public IResult dwnloadPdf(IRequest request) throws CapException {
    ByteArrayOutputStream file = null;
    try {
      file = sampleRptService.generateReport(request);
      return new ByteArrayDownloadResult(request, file.toByteArray(),
          ContextTypeEnum.pdf.toString(), "test.pdf");
    } catch (Exception e) {
      logger.error(e.getMessage(), e);
    } finally {
      IOUtils.closeQuietly(file);
View Full Code Here

    File file = createDecisionTable(request);
    FileInputStream is = null;
    try {
      is = FileUtils.openInputStream(file);
//      return new FileDownloadResult(request, file.getPath(), file.getName(), "xls/plain");
      return new ByteArrayDownloadResult(request,
          IOUtils.toByteArray(is), "xls/plain", file.getName());
    } catch (IOException e) {
      logger.error(e.getMessage(), e);
    } finally {
      IOUtils.closeQuietly(is);
View Full Code Here

TOP

Related Classes of com.iisigroup.cap.response.ByteArrayDownloadResult

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.