Package com.adito.core

Examples of com.adito.core.DownloadContent


        if (id == null) {
            return mapping.findForward("failed");
        }
        FileDownloadPageInterceptListener l = (FileDownloadPageInterceptListener) CoreUtil.getPageInterceptListenerById(request
                        .getSession(),FileDownloadPageInterceptListener.INTERCEPT_ID);
        DownloadContent download = l == null ? null : l.getDownload(Integer.parseInt(id));
        if (l == null || download == null ) {
            return mapping.findForward("failed");
        }

        response.setContentType(download.getMimeType() == null ? "application/octet-stream" : download.getMimeType());
        response.setHeader("Content-Disposition", "attachment; filename=\"" + download.getFileName() + "\"");
        download.sendDownload(response, request);

        return null;

    }
View Full Code Here


            return mapping.findForward("failed");
        }
        FileDownloadPageInterceptListener l = (FileDownloadPageInterceptListener) CoreUtil.getPageInterceptListenerById(request
                        .getSession(), FileDownloadPageInterceptListener.INTERCEPT_ID);
        if (l != null) {
            DownloadContent download = l.getDownload(Integer.parseInt(id));
            if(download == null) {
                log.warn("Expected download " + id + " to be available but it wasn't");
                return mapping.findForward("failed");
            }
            else {
                download.completeDownload(LogonControllerFactory.getInstance().getSessionInfo(request));
                l.removeDownload(download.getId());
                if(l.size() == 0) {
                    CoreUtil.removePageInterceptListener(request.getSession(), l);
                }
                ActionForward fwd = download.getForward();
                if(fwd != null) {
                    return fwd;
                }  
            }
        }
View Full Code Here

TOP

Related Classes of com.adito.core.DownloadContent

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.