Class UploadedFileWrapper

java.lang.Object
org.primefaces.model.file.UploadedFileWrapper
All Implemented Interfaces:
Serializable, javax.faces.component.StateHolder, javax.faces.FacesWrapper<UploadedFile>, UploadedFile

public class UploadedFileWrapper extends Object implements UploadedFile, javax.faces.FacesWrapper<UploadedFile>, javax.faces.component.StateHolder, Serializable
Internal wrapper to avoid the file binaries to beeing saved in the ViewState.
See Also:
  • Constructor Details

    • UploadedFileWrapper

      public UploadedFileWrapper()
    • UploadedFileWrapper

      public UploadedFileWrapper(UploadedFile wrapped)
  • Method Details

    • getWrapped

      public UploadedFile getWrapped()
      Specified by:
      getWrapped in interface javax.faces.FacesWrapper<UploadedFile>
    • saveState

      public Object saveState(javax.faces.context.FacesContext fc)
      Specified by:
      saveState in interface javax.faces.component.StateHolder
    • restoreState

      public void restoreState(javax.faces.context.FacesContext fc, Object o)
      Specified by:
      restoreState in interface javax.faces.component.StateHolder
    • isTransient

      public boolean isTransient()
      Specified by:
      isTransient in interface javax.faces.component.StateHolder
    • setTransient

      public void setTransient(boolean value)
      Specified by:
      setTransient in interface javax.faces.component.StateHolder
    • getSize

      public long getSize()
      Specified by:
      getSize in interface UploadedFile
    • write

      public void write(String filePath) throws Exception
      Specified by:
      write in interface UploadedFile
      Throws:
      Exception
    • getFileName

      public String getFileName()
      Specified by:
      getFileName in interface UploadedFile
    • getInputStream

      public InputStream getInputStream() throws IOException
      Specified by:
      getInputStream in interface UploadedFile
      Throws:
      IOException
    • getContent

      public byte[] getContent()
      Specified by:
      getContent in interface UploadedFile
    • getContentType

      public String getContentType()
      Specified by:
      getContentType in interface UploadedFile
    • delete

      public void delete() throws IOException
      Specified by:
      delete in interface UploadedFile
      Throws:
      IOException