Package org.primefaces.model

Examples of org.primefaces.model.DefaultStreamedContent


  public void cargarImagen(FileUploadEvent event) { 
      System.out.println("XD " + event.getFile().getFileName());
     
      try {
          image = new DefaultStreamedContent(event.getFile().getInputstream());
         
          System.out.println("XD2 " + event.getFile().getFileName());
          System.out.println("XD2 " + event.getFile().getContents());
         
          FacesMessage msg = new FacesMessage("Succesful", event.getFile().getFileName() + " is uploaded.");
View Full Code Here


 
  public void cargarImagenActualiza(FileUploadEvent event) { 
     
      try {
       
        usuario.getPersonas().setScImagen(new DefaultStreamedContent(event.getFile().getInputstream()));
         
          System.out.println("XD" + event.getFile().getFileName());
         
          byte[] foto = event.getFile().getContents();
          usuario.getPersonas().setFotobin(foto);
View Full Code Here

    }

    public StreamedContent getFile()
    {
        InputStream is = JqmClientFactory.getClient().getDeliverableContent(selDel);
        return new DefaultStreamedContent(is, null, selected.getId() + " - " + selDel.getOriginalName());
    }
View Full Code Here

    }

    public StreamedContent getSelOut()
    {
        InputStream is = JqmClientFactory.getClient().getJobLogStdOut(this.selected.getId());
        return new DefaultStreamedContent(is, "text/plain;charset=utf-8", selected.getId() + ".stdout.txt");
    }
View Full Code Here

    }

    public StreamedContent getSelErr()
    {
        InputStream is = JqmClientFactory.getClient().getJobLogStdErr(this.selected.getId());
        return new DefaultStreamedContent(is, "text/plain;charset=utf-8", selected.getId() + ".stderr.txt");
    }
View Full Code Here

    private StreamedContent toStreamedContent(byte[] bytes, String fileName, String contentType)
    {
        InputStream is = new ByteArrayInputStream(bytes);

        StreamedContent file = new DefaultStreamedContent(is, contentType, fileName);

        return file;
    }
View Full Code Here

     * @param fileName Nome desejado para exibição ao usuário.
     * @param file
     * @throws IOException
     */
    public static StreamedContent downloadFile(String fileName, byte[] bytesFile) throws IOException {
        return new DefaultStreamedContent(new ByteArrayInputStream(bytesFile), "application/download", fileName);
    }
View Full Code Here

TOP

Related Classes of org.primefaces.model.DefaultStreamedContent

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.