org.apertereports.util
Class FileStreamer

java.lang.Object
  extended by org.apertereports.util.FileStreamer

public final class FileStreamer
extends Object

A utility class that handles opening of a new window with a report stream.


Method Summary
static void openFile(com.vaadin.Application app, File file, boolean newWindow)
          Opens a new download window with provided content.
static void openFileInCurrentWindow(com.vaadin.Application application, String filename, byte[] reportContent, String mimeType)
          Starts download in current window with provided content.
static void openFileInNewWindow(com.vaadin.Application app, String fileName, byte[] fileContent, String mimeType)
          Opens a new download window with provided content.
static void showFile(com.vaadin.Application app, String reportName, byte[] report, String format)
          Opens a new download window with provided content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

openFileInNewWindow

public static void openFileInNewWindow(com.vaadin.Application app,
                                       String fileName,
                                       byte[] fileContent,
                                       String mimeType)
Opens a new download window with provided content.

Parameters:
app - The application
fileName - The filename linked with the content
fileContent - The content
mimeType - The exact mime type of the content

openFile

public static void openFile(com.vaadin.Application app,
                            File file,
                            boolean newWindow)
Opens a new download window with provided content.

Parameters:
app - The application
file - File to open
newWindow - Determines if open in new window

showFile

public static void showFile(com.vaadin.Application app,
                            String reportName,
                            byte[] report,
                            String format)
Opens a new download window with provided content.

Parameters:
app - The application
reportName - The name of the report
report - The report content
format - The format of the report (i.e. PDF)

openFileInCurrentWindow

public static void openFileInCurrentWindow(com.vaadin.Application application,
                                           String filename,
                                           byte[] reportContent,
                                           String mimeType)
Starts download in current window with provided content.

Parameters:
app - The application
reportName - The name of the report
report - The report content
format - The format of the report (i.e. PDF)


Copyright © 2011-2013. All Rights Reserved.