| java.lang.Object org.millstone.base.data.util.FilesystemContainer
FilesystemContainer | public class FilesystemContainer implements Container.Hierarchical(Code) | | A hierarchical container wrapper for a filesystem.
author: IT Mill Ltd. version: 3.1.1 since: 3.0 |
Inner Class :public class FileItem implements Item | |
Inner Class :public class FileExtensionFilter implements FilenameFilter | |
Constructor Summary | |
public | FilesystemContainer(File root) Construct a new FileSystemContainer with the specified
file as the root of the filesystem. | public | FilesystemContainer(File root, boolean recursive) Construct a new FileSystemContainer with the specified
file as the root of the filesystem. | public | FilesystemContainer(File root, String extension, boolean recursive) Construct a new FileSystemContainer with the specified
file as the root of the filesystem. | public | FilesystemContainer(File root, FilenameFilter filter, boolean recursive) Construct a new FileSystemContainer with the specified
root and recursivity status. |
FILE_PROPERTIES | public static Collection FILE_PROPERTIES(Code) | | List of the string identifiers for the available properties
|
PROPERTY_ICON | public static String PROPERTY_ICON(Code) | | String identifier of a file's "icon" property.
|
PROPERTY_LASTMODIFIED | public static String PROPERTY_LASTMODIFIED(Code) | | String identifier of a file's "last modified" property.
|
PROPERTY_NAME | public static String PROPERTY_NAME(Code) | | String identifier of a file's "name" property.
|
PROPERTY_SIZE | public static String PROPERTY_SIZE(Code) | | String identifier of a file's "size" property.
|
FilesystemContainer | public FilesystemContainer(File root)(Code) | | 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. Null values are ignored. |
FilesystemContainer | public FilesystemContainer(File root, boolean recursive)(Code) | | 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 Parameters: recursive - should the container recursively contain subdirectories. |
FilesystemContainer | public FilesystemContainer(File root, String extension, boolean recursive)(Code) | | Construct a new FileSystemContainer with the specified
file as the root of the filesystem.
Parameters: root - root file for the new file-system container Parameters: extension - Filename extension (w/o separator) to limit the files in container. Parameters: recursive - should the container recursively contain subdirectories. |
FilesystemContainer | public FilesystemContainer(File root, FilenameFilter filter, boolean recursive)(Code) | | Construct a new FileSystemContainer with the specified
root and recursivity status.
Parameters: root - root file for the new file-system container Parameters: filter - Filename filter to limit the files in container. Parameters: recursive - should the container recursively contain subdirectories. |
addRoot | public void addRoot(File root)(Code) | | Add new root file directory.
Adds a file to be included as root file directory in the FilesystemContainer.
Parameters: root - File to be added as root directory. Null values are ignored. |
areChildrenAllowed | public boolean areChildrenAllowed(Object itemId)(Code) | | 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.
true if the specified Item is a directory,false otherwise. |
getContainerProperty | public Property getContainerProperty(Object itemId, Object propertyId)(Code) | | 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: itemId - ID of the file whose property is requested Parameters: propertyId - The property's ID the requested property's value, or null |
getContainerPropertyIds | public Collection getContainerPropertyIds()(Code) | | Gets the collection of available file properties.
Unmodifiable collection containing all available fileproperties. |
getFilter | public FilenameFilter getFilter()(Code) | | Returns the file filter used to limit the files in this container.
Used filter instance or null if no filter is assigned. |
getType | public Class getType(Object propertyId)(Code) | | 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: propertyId - ID of the property whose type is requested. data type of the requested property, or null |
isRecursive | public boolean isRecursive()(Code) | | Is this container recursive filesystem.
true if container is recursive, false otherwise. |
setChildrenAllowed | public boolean setChildrenAllowed(Object itemId, boolean areChildrenAllowed) throws UnsupportedOperationException(Code) | | Return false - conversion from files to directories is not
supported.
false |
setFilter | public void setFilter(FilenameFilter filter)(Code) | | Sets the file filter used to limit the files in this container.
Parameters: filter - The filter to set. null disables filtering. |
setFilter | public void setFilter(String extension)(Code) | | 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. |
setRecursive | public void setRecursive(boolean recursive)(Code) | | 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.
Parameters: New - value for recursive property. |
size | public int size()(Code) | | Gets the number of Items in the container. In effect, this is the
combined amount of files and directories.
Number of Items in the container. |
|
|