Package com.infoclinika.mssharing.fileserver.impl

Examples of com.infoclinika.mssharing.fileserver.impl.FileStorageService


        //TODO: change API of storage service and remove explicit cast
        if (!(storageService instanceof FileStorageService)) {
            throw new IllegalStateException("Please supply the FileStorageService instance");
        }
        final FileStorageService fileStorageService = (FileStorageService) storageService;

        final ZipOutputStream zos = new ZipOutputStream(response.getOutputStream());
        final Iterable<DashboardReader.FileLine> filesToDownload = getFilesToDownload(request);


        if (request.experimentId != null) {
            addExperimentCSVFile(request, zos);
            addAttachments(request, zos);
        }

        long totalSizeInBytes = 0;

        for (DashboardReader.FileLine fileLine : filesToDownload) {
            totalSizeInBytes = totalSizeInBytes + fileLine.columns.sizeInBytes;
        }

        for (final DashboardReader.FileLine file : filesToDownload) {
            final NodePath nodePath = new NodePath(file.contentId);
            pushFileToZip(zos, file.columns.name, new InputStreamProvider() {
                @Override
                public S3ObjectInputStream get() {
                    return fileStorageService.getAsStream(nodePath);
                }
            });
        }
        zos.close();
        //Set cookie to satisfy AJAX downloader at the client:
View Full Code Here

TOP

Related Classes of com.infoclinika.mssharing.fileserver.impl.FileStorageService

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.