Package org.dspace.app.webui.util

Examples of org.dspace.app.webui.util.FileUploadListener


        if (session == null)
        {
            return;
        }

        FileUploadListener listner = (FileUploadListener) session
                .getAttribute(FileUploadRequest.FILE_UPLOAD_LISTNER);
        if (listner == null || listner.getContentLength() == 0)
        {
            return;
        }
        else
        {
            long contentLength = listner.getContentLength();
            UploadProgressDTO dto = new UploadProgressDTO();
            long bytesRead = listner.getBytesRead();
            dto.readBytes = bytesRead;
            dto.totalBytes = contentLength;
            Gson gson = new Gson();
            resp.getWriter().write(gson.toJson(dto));
            if (listner.isCompleted())
            {
                session.removeAttribute(FileUploadRequest.FILE_UPLOAD_LISTNER);
            }
        }
View Full Code Here

TOP

Related Classes of org.dspace.app.webui.util.FileUploadListener

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.