Package org.directwebremoting.io

Examples of org.directwebremoting.io.OutputStreamLoader


    /* (non-Javadoc)
     * @see org.directwebremoting.extend.DownloadManager#addFile(org.directwebremoting.extend.DownloadManager.FileGenerator)
     */
    public String addFileTransfer(FileTransfer transfer) throws IOException
    {
        OutputStreamLoader loader = null;
        ByteArrayOutputStream out = null;
        try
        {
            out = new ByteArrayOutputStream();
            String mimeType = transfer.getMimeType();
            loader = transfer.getOutputStreamLoader();
            loader.load(out);
            String base64data = new String(Base64.encodeBase64(out.toByteArray()));
            return "'data:" + mimeType + ";base64," + base64data + "'";
        }
        finally
        {
View Full Code Here


                response.setHeader("Content-disposition", "attachment; filename=\"" + filename + "\"");
            }

            response.setContentType(transfer.getMimeType());

            OutputStreamLoader loader = null;
            try
            {
                loader = transfer.getOutputStreamLoader();
                loader.load(response.getOutputStream());
            }
            finally
            {
                LocalUtil.close(loader);
            }
View Full Code Here

                        + transfer.getMimeType().replace("/", ".")
                        + PART_SEPARATOR
                        + transfer.getFilename();

        OutputStream out = null;
        OutputStreamLoader loader = null;
        try
        {
            out = new FileOutputStream(new File(downloadFileCache, filename));
            loader = transfer.getOutputStreamLoader();
            loader.load(out);
        }
        catch (IOException ex)
        {
            log.error("Failed to write file to cache", ex);
        }
View Full Code Here

                        + encodeFileNameSegment(transfer.getMimeType())
                        + PART_SEPARATOR
                        + encodeFileNameSegment(transfer.getFilename());

        OutputStream out = null;
        OutputStreamLoader loader = null;
        try
        {
            out = new FileOutputStream(new File(downloadFileCache, filename));
            loader = transfer.getOutputStreamLoader();
            loader.load(out);
        }
        catch (IOException ex)
        {
            log.error("Failed to write file to cache", ex);
        }
View Full Code Here

TOP

Related Classes of org.directwebremoting.io.OutputStreamLoader

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.