A hierarchical container wrapper for a filesystem.
3.0
Inheritance Path. java.lang.Object-> com.itmill.toolkit.data.util.FilesystemContainer
Parameters
root
root file for the new file-system container. Null values are ignored.
Construct a new
FileSystemContainer
with the specified
file as the root of the filesystem. The files are included recursively.
Parameters
root
root file for the new file-system container
recursive
should the container recursively contain subdirectories.
Construct a new
FileSystemContainer
with the specified
file as the root of the filesystem. The files are included recursively.
Parameters
root
root file for the new file-system container
filter
Filename filter to limit the files in container.
recursive
should the container recursively contain subdirectories.
Construct a new
FileSystemContainer
with the specified
root and recursivity status.
Parameters
root
root file for the new file-system container
extension
Filename extension (w/o separator) to limit the files in container.
recursive
should the container recursively contain subdirectories.
Construct a new
FileSystemContainer
with the specified
file as the root of the filesystem.
addItem()
addItem(java.lang.Object)
Parameters
root
File to be added as root directory. Null values are ignored.
Add new root file directory. Adds a file to be included as root file directory in the FilesystemContainer.
Parameters
true
if the specified Item is a directory,
false
otherwise.
Tests if the specified Item in the container may have children.
Since a
FileSystemContainer
contains files and
directories, this method returns
true
for directory
Items only.
Parameters
itemId
ID of the Item whose children the caller is interested in
An unmodifiable collection containing the IDs of all other Items that are children in the container hierarchy
Gets the IDs of all Items that are children of the specified Item. The returned collection is unmodifiable.
Parameters
itemId
ID of the file whose property is requested
propertyId
The property's ID
the requested property's value, or
null
Gets the specified property of the specified file Item. The
available file properties are "Name", "Size" and "Last Modified".
If
propertyId
is not one of those,
null
is
returned.
Parameters
Unmodifiable collection containing all available file properties.
Gets the collection of available file properties.
Parameters
Used filter instance or null if no filter is assigned.
Returns the file filter used to limit the files in this container.
Parameters
itemId
ID of the Item whose parent the caller wishes to find out.
the ID of the parent Item. Will be
null
if the
specified Item is a root element.
Gets the ID of the parent Item of the specified Item.
Parameters
propertyId
ID of the property whose type is requested.
data type of the requested property, or
null
Gets the specified property's data type. "Name" is a
String
, "Size" is a
Long
, "Last Modified"
is a
Date
. If
propertyId
is not one of
those,
null
is returned.
Parameters
itemId
ID of the Item whose leaf status is to be tested
true
if the specified Item is a leaf,
false
if not
Tests if the Item specified with
itemId
has any child
Items, that is, is it a leaf Item. The
getChildren(java.lang.Object)
method always returns
null
for leaf Items.
Note that being a leaf does not imply whether or not an Item is allowed to have children.
.
Parameters
true if container is recursive, false otherwise.
Is this container recursive filesystem.
Parameters
itemId
ID of the Item whose root status is to be tested
true
if the specified Item is a root,
false
if not
Tests if the Item specified with
itemId
is a root
Item. The hierarchical container can have more than one root and must
have at least one unless it is empty. The
getParent(java.lang.Object)
method always returns
null
for root Items.
removeAllItems()
removeItem(java.lang.Object)
Parameters
An unmodifiable collection containing IDs of all root elements of the container
Gets the IDs of all Items in the container that don't have a parent.
Such items are called
root
Items. The returned
collection is unmodifiable.
Parameters
false
Return false - conversion from files to directories is not supported.
Parameters
filter
The filter to set.
null
disables filtering.
Sets the file filter used to limit the files in this container.
Parameters
extension
Filename extension (w/o separator) to limit the files in container.
Sets the file filter used to limit the files in this container.
Parameters
false
Return false - moving files around in the filesystem is not supported.
Parameters
New
value for recursive property.
Sets the container recursive property. Set this to false to limit the files directly under the root file. Note, that this is meaningful only if the root really is a directory.