|
 |
The Folder object represents a folder in a DataWeb Web. By using the folder object and its associated methods you can create and delete folders within your Web, as well as arrange and modify the data within the folders of your Web. (Note that only users with Designer permissions or higher can run scripts which call methods on the File and Folder objects.)
Constructor
[new] Folder(path) |
Constructs and returns a new Folder object instance. It does not create a folder on the file system. | | Instance Properties
name |
Holds the name of the folder. The name property does not include a leading or trailing slash. |
path |
Holds the path of the folder. The path property includes both leading and trailing slashes. | |
Instance Methods
copy |
Copies a specified folder from one location to another.
|
exists |
Checks to see if a specified folder exists in file system hierarchy.
|
getDateCreated |
Returns a Date object containing the date/time when the folder was created. |
getParentPath |
Returns the path of a specified folder's parent folder.
|
getRole |
Returns the role for a specified folder.
|
isDataFolder |
Checks to see if a specified folder is a data folder.
|
isRootFolder |
Checks to see if a specified folder is the root folder of a Web.
|
isSecurityInherited |
Checks to see if a specified folder has inherited it's security settings from a parent folder.
|
move |
Moves a specified folder from one location to another.
|
remove |
Removes a specified folder from the file system. |
rename |
Resets a specified folder's name and path to new values.
|
setRole |
Set a FolderRole for a group.
|
setSecurityInherited |
Causes a specified folder to inherit or not to inherit the security settings of its parent folder.
| |
Prototype Methods
create |
Creates a folder in the file system hierarchy as well as a corresponding Folder object instance.
|
createNew |
Creates a folder in the file system hierarchy as well as a corresponding Folder object instance.
|
exists |
Checks to see if a specified folder exists in the file system hierarchy.
|
getExisting |
A Folder object instance is created and returned if a specified folder exists.
|
remove |
Removes a specified folder from the file system hierarchy
| |
Examples
var fol = new Folder("/someFolder/");
The following example, then placed within a .view file, outputs a list of links to the files within the root directory.
var fold = new Folder("/");
var arr = fold.files.getObjects();
for(var i = 0; i<arr.length; i++)
response.write("<a href='http://"
+ web.name + "." + web.domain
+ "/" + arr[i].name
+ "?_admin=source'>" + arr[i].name + "</a><br>");
|