Water 5-System Interfaces-FilesystemCreates a folder resource from a path
Contract| Parameter key | Default value | Type | | a_uri | opt | | contract | opt | | type | opt | | a_response | null | | http_message | opt | | base_protocol | false | boolean | | name | opt | | protocol_name | "file" | string | | of | of | instances | | 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 key | Default value | Type |
| a_uri | opt |
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 key | Default value | Type |
| name | opt |
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
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.
© Copyright 2007 Clear Methods, Inc.