Package org.exoplatform.download

Examples of org.exoplatform.download.InputStreamDownloadResource


            UIFormUploadInput input = uiForm.getChildById("name" + index);
            UploadResource uploadResource = input.getUploadResource();
            if (uploadResource != null)
            {
               DownloadResource dresource =
                  new InputStreamDownloadResource(input.getUploadDataAsStream(), uploadResource.getMimeType());
               dresource.setDownloadName(uploadResource.getFileName());
               downloadLink[index] = dservice.getDownloadLink(dservice.addDownloadResource(dresource));
               fileName[index] = uploadResource.getFileName();
               inputName[index] = "name" + index;
            }
         }
View Full Code Here


            List<String> inputName = new ArrayList<String>();
            for (int index = 0; index <= 2; index++) {
                UIFormUploadInput input = uiForm.getChildById("name" + index);
                UploadResource uploadResource = input.getUploadResource();
                if (uploadResource != null) {
                    DownloadResource dresource = new InputStreamDownloadResource(input.getUploadDataAsStream(),
                            uploadResource.getMimeType());
                    dresource.setDownloadName(uploadResource.getFileName());
                    downloadLink.add(dservice.getDownloadLink(dservice.addDownloadResource(dresource)));
                    fileName.add(uploadResource.getFileName());
                    inputName.add("name" + index);
                }
            }

            for (int index = 3; index < 5; index++) {
                UIUploadInput input = uiForm.getChildById("name" + index);
                UploadResource[] uploadResources = input.getUploadResources();
                for (UploadResource uploadResource : uploadResources) {
                    DownloadResource dresource = new InputStreamDownloadResource(new FileInputStream(new File(
                            uploadResource.getStoreLocation())), uploadResource.getMimeType());
                    dresource.setDownloadName(uploadResource.getFileName());
                    downloadLink.add(dservice.getDownloadLink(dservice.addDownloadResource(dresource)));
                    fileName.add(uploadResource.getFileName());
                    inputName.add("name" + index);
                }
            }
View Full Code Here

TOP

Related Classes of org.exoplatform.download.InputStreamDownloadResource

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.