public class BasicFileItemWrapper extends Object implements FileItemWrapper
FileItemWrapper
.
This class perform the bridge between an Item
and a UploadReceiver
. Modifier and Type | Field and Description |
---|---|
protected long |
fileSize |
protected AbstractJcrNodeAdapter |
item |
Constructor and Description |
---|
BasicFileItemWrapper(AbstractJcrNodeAdapter jcrItem,
File tmpDirectory) |
BasicFileItemWrapper(File tmpDirectory) |
Modifier and Type | Method and Description |
---|---|
void |
clearProperties()
Clear the local variables.
|
String |
getExtension() |
File |
getFile() |
protected com.vaadin.data.Property<?> |
getFileFormatProperty() |
String |
getFileName() |
protected com.vaadin.data.Property<?> |
getFileNameProperty()
Used to access the Item property in order to set the input dataSource of a TextField.
|
long |
getFileSize() |
String |
getMimeType() |
protected void |
initJcrItemProperty(AbstractJcrNodeAdapter jcrItem)
Initializes the JCR node adapter with the mandatory default properties.
|
boolean |
isEmpty()
Return true if the binaryData is not empty.
|
void |
populateFromItem(com.vaadin.data.Item jcrItem)
Populate the local variable with the values of the
Item . |
void |
populateFromReceiver(UploadReceiver receiver)
Populate the local variables with the values of the {UploadReceiver receiver}.
|
protected void |
populateItem()
Update the
Item based on the local values. |
protected void |
populateWrapperFromItem()
Populate the wrapper variable based on the current Item.
|
protected void |
populateWrapperFromReceiver(UploadReceiver receiver)
Populate this
FileItemWrapper with the UploadReceiver informations. |
void |
reloadPrevious()
Used to restore the previous Uploaded File if existing.
|
protected long fileSize
protected AbstractJcrNodeAdapter item
public BasicFileItemWrapper(File tmpDirectory)
public BasicFileItemWrapper(AbstractJcrNodeAdapter jcrItem, File tmpDirectory)
public void populateFromItem(com.vaadin.data.Item jcrItem)
Item
.populateFromItem
in interface FileItemWrapper
protected void populateWrapperFromItem()
public void populateFromReceiver(UploadReceiver receiver)
Item
with this new values.populateFromReceiver
in interface FileItemWrapper
public void clearProperties()
clearProperties
in interface FileItemWrapper
public void reloadPrevious()
FileItemWrapper
reloadPrevious
in interface FileItemWrapper
public boolean isEmpty()
FileItemWrapper
isEmpty
in interface FileItemWrapper
protected void populateWrapperFromReceiver(UploadReceiver receiver)
FileItemWrapper
with the UploadReceiver
informations.protected void populateItem()
Item
based on the local values.protected void initJcrItemProperty(AbstractJcrNodeAdapter jcrItem)
public long getFileSize()
getFileSize
in interface FileItemWrapper
public String getMimeType()
getMimeType
in interface FileItemWrapper
public String getExtension()
getExtension
in interface FileItemWrapper
public String getFileName()
getFileName
in interface FileItemWrapper
public File getFile()
getFile
in interface FileItemWrapper
protected com.vaadin.data.Property<?> getFileNameProperty()
protected com.vaadin.data.Property<?> getFileFormatProperty()
Copyright © 2015 Magnolia International Ltd.. All rights reserved.