Examples of UploadService


Examples of org.exoplatform.upload.UploadService

   public UIFormUploadInput(String name, String bindingExpression, int limit, boolean isAutoUpload)
   {
      super(name, bindingExpression, String.class);
      uploadId_ = Integer.toString(Math.abs(hashCode()));
      this.isAutoUpload = isAutoUpload;
      UploadService service = getApplicationComponent(UploadService.class);
      service.addUploadLimit(uploadId_, Integer.valueOf(limit)); // Use the limit set by constructor.
      setComponentConfig(UIFormUploadInput.class, null);
   }
View Full Code Here

Examples of org.exoplatform.upload.UploadService

   {
      uploadResource_ = null;
      boolean hasUpload = "true".equals(input);
      if (hasUpload)
      {
         UploadService service = getApplicationComponent(UploadService.class);
         uploadResource_ = service.getUploadResource(uploadId_);
      }
   }
View Full Code Here

Examples of org.exoplatform.upload.UploadService

     
      for(int i = 0; i < limitFile; i++)
      {
         uploadIds.add( new StringBuffer().append(Math.abs(this.hashCode())).append('-').append(i).toString());
      }
      UploadService service = getApplicationComponent(UploadService.class);
      for(int i = 0; i < uploadIds.size(); i++)
      {
         service.addUploadLimit(uploadIds.get(i), null); // Use the limit set by the service. Warning, the service can allow no size limit (value to 0)
      }
      setComponentConfig(UIUploadInput.class, null);
   }
View Full Code Here

Examples of org.exoplatform.upload.UploadService

     
      for(int i = 0; i < limitFile; i++)
      {
         uploadIds.add(new StringBuffer().append(Math.abs(hashCode())).append('-').append(i).toString());
      }
      UploadService service = getApplicationComponent(UploadService.class);
      for(int i = 0; i < limitFile; i++)
      {
         service.addUploadLimit(uploadIds.get(i), Integer.valueOf(limitSize), unit);
      }
      setComponentConfig(UIUploadInput.class, null);
   }
View Full Code Here

Examples of org.exoplatform.upload.UploadService

      String lastedUploadId = uploadIds.getLast();
      String hash = lastedUploadId.substring(0, lastedUploadId.indexOf('-'));
      int newIndex = Integer.valueOf(lastedUploadId.substring(hash.length()  + 1)) + 1;
      String newUploadId = new StringBuffer().append(hash).append('-').append(newIndex).toString();
      uploadIds.addLast(newUploadId);
      UploadService service = getApplicationComponent(UploadService.class);
      service.addUploadLimit(newUploadId, limitSize, limitUnit);
   }
View Full Code Here

Examples of org.exoplatform.upload.UploadService

   }
  
   public void removeUploadId(String uploadId)
   {
      uploadIds.remove(uploadId);
      UploadService service = getApplicationComponent(UploadService.class);
      service.removeUploadLimit(uploadId);
   }
View Full Code Here

Examples of org.exoplatform.upload.UploadService

      service.removeUploadLimit(uploadId);
   }
  
   public UploadResource[] getUploadResources() {
      List<UploadResource> holder = new ArrayList<UploadResource>();
      UploadService service = getApplicationComponent(UploadService.class);
      for(int i = 0; i < uploadIds.size(); i++)
      {
         UploadResource uploadResource = service.getUploadResource(uploadIds.get(i));
         if(uploadResource == null) continue;
         holder.add(uploadResource) ;
      }
      return holder.toArray(new UploadResource[holder.size()]);
   }
View Full Code Here

Examples of org.exoplatform.upload.UploadService

      }
      return holder.toArray(new UploadResource[holder.size()]);
   }
  
   public UploadResource getUploadResource(String uploadId) {
      UploadService service = getApplicationComponent(UploadService.class);
      return service.getUploadResource(uploadId);
   }
View Full Code Here

Examples of org.exoplatform.upload.UploadService

   }
  
   public InputStream[] getUploadDataAsStreams() throws FileNotFoundException
   {
      List<InputStream> holder = new ArrayList<InputStream>();
      UploadService service = getApplicationComponent(UploadService.class);
      for(int i = 0; i < uploadIds.size(); i++)
      {
         UploadResource uploadResource = service.getUploadResource(uploadIds.get(i));
         if(uploadResource == null) continue;
         File file = new File(uploadResource.getStoreLocation());
         holder.add(new FileInputStream(file));
      }
      return holder.toArray(new InputStream[holder.size()]);
View Full Code Here

Examples of org.exoplatform.upload.UploadService

      return holder.toArray(new InputStream[holder.size()]);
   }
  
   public InputStream getUploadDataAsStream(String uploadId) throws FileNotFoundException
   {
      UploadService service = getApplicationComponent(UploadService.class);
      UploadResource uploadResource = service.getUploadResource(uploadId);
      if(uploadResource == null) return null;
      else return new FileInputStream(new File(uploadResource.getStoreLocation()));
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.