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 void
delete()
byte[]
getContent()
String
getContentType()
String
getFileName()
InputStream
getInputStream()
long
getSize()
UploadedFile
getWrapped()
boolean
isTransient()
void
restoreState(javax.faces.context.FacesContext fc, Object o)
Object
saveState(javax.faces.context.FacesContext fc)
void
setTransient(boolean value)
void
write(String filePath)
-
-
-
Constructor Detail
-
UploadedFileWrapper
public UploadedFileWrapper()
-
UploadedFileWrapper
public UploadedFileWrapper(UploadedFile wrapped)
-
-
Method Detail
-
getWrapped
public UploadedFile getWrapped()
- Specified by:
getWrapped
in interfacejavax.faces.FacesWrapper<UploadedFile>
-
saveState
public Object saveState(javax.faces.context.FacesContext fc)
- Specified by:
saveState
in interfacejavax.faces.component.StateHolder
-
restoreState
public void restoreState(javax.faces.context.FacesContext fc, Object o)
- Specified by:
restoreState
in interfacejavax.faces.component.StateHolder
-
isTransient
public boolean isTransient()
- Specified by:
isTransient
in interfacejavax.faces.component.StateHolder
-
setTransient
public void setTransient(boolean value)
- Specified by:
setTransient
in interfacejavax.faces.component.StateHolder
-
getSize
public long getSize()
- Specified by:
getSize
in interfaceUploadedFile
-
write
public void write(String filePath) throws Exception
- Specified by:
write
in interfaceUploadedFile
- Throws:
Exception
-
getFileName
public String getFileName()
- Specified by:
getFileName
in interfaceUploadedFile
-
getInputStream
public InputStream getInputStream() throws IOException
- Specified by:
getInputStream
in interfaceUploadedFile
- Throws:
IOException
-
getContent
public byte[] getContent()
- Specified by:
getContent
in interfaceUploadedFile
-
getContentType
public String getContentType()
- Specified by:
getContentType
in interfaceUploadedFile
-
delete
public void delete() throws IOException
- Specified by:
delete
in interfaceUploadedFile
- Throws:
IOException
-
-