Water 5-System Interfaces-Filesystem
class resource.filesystem.folder
Creates a folder resource from a path
Contract
Parameter keyDefault valueType
a_uriopt
contractopt
typeopt
a_responsenull
http_messageopt
base_protocolfalseboolean
nameopt
protocol_name"file"string
ofofinstances
Water Contract
<class resource.filesystem.folder
/>

See also: create, keys, get_files, get_folders, file, set_file_content_and_create_folders_as_needed, remove, vector

A folder represents a directory of files and subfolders.

a wob
Parameter keyDefault valueType
a_uriopt
This field specifies the path to the desired folder resource.

Example: Create a folder object
<folder "file:///C:/Documents and Settings/mstemen/My Documents" />
Example: Using Water's logical specifier
<folder "logical://user" />
To create the folder on the filesystem, use the create method.
<folder "logical://user/some_new_folder" />.<create />

a wob
Parameter keyDefault valueType
nameopt
Providing the name argument causes this folder to be added to the of field of the folder class. Once a folder is named, it can be accessed by using the syntax folder.of.folder_name . The keys method can be used to get the names of the files and folders in a specified folder. The following example shows how to use the name field to allow us to reference the folder more easily.

Example: Get keys using folder.of
<folder "logical://user" name="foo" />
folder.of.foo.<keys />

a wob
Parameter keyDefault valueType
ofofinstances
This field is a collection of instances of folder that have been named using the name field (see above). When a named instance is no longer needed, it can be removed from this collection by calling the remove method. Attempts to access a non-existent instance will result in an error.

Example: Removing a folder instance
<folder "logical://user/protected_folder" name="foo" />
folder.of.foo.<keys />
folder.of.<remove "foo" />
If the named instance exists, remove removes the instance and returns the folder, otherwise it errors. See the remove method for more information.