Package org.primefaces.model.file
Class UploadedFileWrapper
- java.lang.Object
-
- org.primefaces.model.file.UploadedFileWrapper
-
- All Implemented Interfaces:
javax.faces.component.StateHolder,javax.faces.FacesWrapper<UploadedFile>,UploadedFile
public class UploadedFileWrapper extends Object implements UploadedFile, javax.faces.FacesWrapper<UploadedFile>, javax.faces.component.StateHolder
Internal wrapper to avoid the file binaries to beeing saved in the ViewState.
-
-
Constructor Summary
Constructors Constructor Description UploadedFileWrapper()UploadedFileWrapper(UploadedFile wrapped)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete()byte[]getContent()StringgetContentType()StringgetFileName()InputStreamgetInputStream()longgetSize()UploadedFilegetWrapped()booleanisTransient()voidrestoreState(javax.faces.context.FacesContext fc, Object o)ObjectsaveState(javax.faces.context.FacesContext fc)voidsetTransient(boolean value)voidwrite(String filePath)
-
-
-
Constructor Detail
-
UploadedFileWrapper
public UploadedFileWrapper()
-
UploadedFileWrapper
public UploadedFileWrapper(UploadedFile wrapped)
-
-
Method Detail
-
getWrapped
public UploadedFile getWrapped()
- Specified by:
getWrappedin interfacejavax.faces.FacesWrapper<UploadedFile>
-
saveState
public Object saveState(javax.faces.context.FacesContext fc)
- Specified by:
saveStatein interfacejavax.faces.component.StateHolder
-
restoreState
public void restoreState(javax.faces.context.FacesContext fc, Object o)- Specified by:
restoreStatein interfacejavax.faces.component.StateHolder
-
isTransient
public boolean isTransient()
- Specified by:
isTransientin interfacejavax.faces.component.StateHolder
-
setTransient
public void setTransient(boolean value)
- Specified by:
setTransientin interfacejavax.faces.component.StateHolder
-
getSize
public long getSize()
- Specified by:
getSizein interfaceUploadedFile
-
write
public void write(String filePath) throws Exception
- Specified by:
writein interfaceUploadedFile- Throws:
Exception
-
getFileName
public String getFileName()
- Specified by:
getFileNamein interfaceUploadedFile
-
getInputStream
public InputStream getInputStream() throws IOException
- Specified by:
getInputStreamin interfaceUploadedFile- Throws:
IOException
-
getContent
public byte[] getContent()
- Specified by:
getContentin interfaceUploadedFile
-
getContentType
public String getContentType()
- Specified by:
getContentTypein interfaceUploadedFile
-
delete
public void delete() throws IOException- Specified by:
deletein interfaceUploadedFile- Throws:
IOException
-
-