Package com.vaadin.data.util
Class FilesystemContainer.FileItem
- java.lang.Object
-
- com.vaadin.data.util.FilesystemContainer.FileItem
-
- All Implemented Interfaces:
Item,Serializable
- Enclosing class:
- FilesystemContainer
public class FilesystemContainer.FileItem extends Object implements Item
A Item wrapper for files in a filesystem.- Since:
- 3.0
- Author:
- Vaadin Ltd.
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.data.Item
Item.Editor, Item.PropertySetChangeEvent, Item.PropertySetChangeListener, Item.PropertySetChangeNotifier, Item.Viewer
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddItemProperty(Object id, Property property)Filesystem container does not support adding new properties.booleanequals(Object obj)Tests if the given object is the same as the this object.ResourcegetIcon()Gets the icon of this file.PropertygetItemProperty(Object id)Gets the Property corresponding to the given Property ID stored in the Item.Collection<String>getItemPropertyIds()Gets the collection of IDs of all Properties stored in the Item.StringgetName()Gets the name of this file.longgetSize()Gets the size of this file.inthashCode()Calculates a integer hash-code for the Property that's unique inside the Item containing the Property.DatelastModified()Gets the last modified date of this file.booleanremoveItemProperty(Object id)Filesystem container does not support removing properties.StringtoString()
-
-
-
Method Detail
-
getItemProperty
public Property getItemProperty(Object id)
Description copied from interface:ItemGets the Property corresponding to the given Property ID stored in the Item. If the Item does not contain the Property,nullis returned.- Specified by:
getItemPropertyin interfaceItem- Parameters:
id- identifier of the Property to get- Returns:
- the Property with the given ID or
null
-
getItemPropertyIds
public Collection<String> getItemPropertyIds()
Description copied from interface:ItemGets the collection of IDs of all Properties stored in the Item.- Specified by:
getItemPropertyIdsin interfaceItem- Returns:
- unmodifiable collection containing IDs of the Properties stored the Item
-
hashCode
public int hashCode()
Calculates a integer hash-code for the Property that's unique inside the Item containing the Property. Two different Properties inside the same Item contained in the same list always have different hash-codes, though Properties in different Items may have identical hash-codes.
-
equals
public boolean equals(Object obj)
Tests if the given object is the same as the this object. Two Properties got from an Item with the same ID are equal.
-
lastModified
public Date lastModified()
Gets the last modified date of this file.- Returns:
- Date
-
getName
public String getName()
Gets the name of this file.- Returns:
- file name of this file.
-
getIcon
public Resource getIcon()
Gets the icon of this file.- Returns:
- the icon of this file.
-
getSize
public long getSize()
Gets the size of this file.- Returns:
- size
-
toString
public String toString()
- Overrides:
toStringin classObject- See Also:
Object.toString()
-
addItemProperty
public boolean addItemProperty(Object id, Property property) throws UnsupportedOperationException
Filesystem container does not support adding new properties.- Specified by:
addItemPropertyin interfaceItem- Parameters:
id- ID of the new Propertyproperty- the Property to be added and associated with the id- Returns:
trueif the operation succeeded,falseif not- Throws:
UnsupportedOperationException- if the operation is not supported.- See Also:
Item.addItemProperty(Object, Property)
-
removeItemProperty
public boolean removeItemProperty(Object id) throws UnsupportedOperationException
Filesystem container does not support removing properties.- Specified by:
removeItemPropertyin interfaceItem- Parameters:
id- ID of the Property to be removed- Returns:
trueif the operation succeeded- Throws:
UnsupportedOperationException- if the operation is not supported.falseif not- See Also:
Item.removeItemProperty(Object)
-
-