Class DirectoryOperations
Contains all operations that can be made against a directory
Inheritance
Inherited Members
Namespace: EPiServer.Web.Hosting.Versioning.Store
Assembly: EPiServer.dll
Version: 8.11.0Syntax
public class DirectoryOperations
Constructors
DirectoryOperations(String, String)
Initializes a new instance of the DirectoryOperations class.
Declaration
public DirectoryOperations(string repositoryId, string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | repositoryId | The repository id. |
System.String | filePath | The file path. |
Methods
CreateDirectory(Object, String, String)
Creates a new directory with given name and relates it to given id.
Declaration
public DirectoryItem CreateDirectory(object dirId, string name, string userName)
Parameters
Type | Name | Description |
---|---|---|
System.Object | dirId | The dir id toi associate the new directory item with |
System.String | name | The name of the directory |
System.String | userName | Name of the user. |
Returns
Type | Description |
---|---|
DirectoryItem |
CreateDirectory(String)
Creates a new root directory with given name
Declaration
public DirectoryItem CreateDirectory(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name. |
Returns
Type | Description |
---|---|
DirectoryItem |
CreateRoot(String)
Creates a new root directory
Declaration
public object CreateRoot(string rootName)
Parameters
Type | Name | Description |
---|---|---|
System.String | rootName | Name of the root. |
Returns
Type | Description |
---|---|
System.Object |
DeleteDirectory(Object, Object)
Deletes a directory
Declaration
public void DeleteDirectory(object parentDirId, object dirId)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parentDirId | The parent dir id. |
System.Object | dirId | The dir id. |
GetChildDirectory(String, DirectoryItem)
Gets the child directory with given name and parent
Declaration
public DirectoryItem GetChildDirectory(string name, DirectoryItem parent)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the directory |
DirectoryItem | parent | The parent to the directory |
Returns
Type | Description |
---|---|
DirectoryItem |
GetChildFile(String, DirectoryItem)
Gets the file item for a directory
Declaration
public FileItem GetChildFile(string name, DirectoryItem parent)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the file |
DirectoryItem | parent | The directory where the file resides |
Returns
Type | Description |
---|---|
FileItem |
GetDirectories(Object)
Gets all directories related to an item
Declaration
public DirectoryItem[] GetDirectories(object dirId)
Parameters
Type | Name | Description |
---|---|---|
System.Object | dirId | The dir id to get directories for |
Returns
Type | Description |
---|---|
DirectoryItem[] |
GetDirectory(Object)
Gets the directory with given id
Declaration
public DirectoryItem GetDirectory(object dirId)
Parameters
Type | Name | Description |
---|---|---|
System.Object | dirId | The dir id. |
Returns
Type | Description |
---|---|
DirectoryItem |
GetParentDirectory(Object)
Gets the parent directory for an object
Declaration
public DirectoryItem GetParentDirectory(object id)
Parameters
Type | Name | Description |
---|---|---|
System.Object | id | The id of the object |
Returns
Type | Description |
---|---|
DirectoryItem |
MoveDirectory(Object, Object, Object)
Moves the directory from one parent to another parent
Declaration
public void MoveDirectory(object dirId, object currentParent, object newParent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | dirId | The dir id. |
System.Object | currentParent | The current parent. |
System.Object | newParent | The new parent. |
RenameDirectory(Object, String)
Renames a directory
Declaration
public void RenameDirectory(object dirId, string newName)
Parameters
Type | Name | Description |
---|---|---|
System.Object | dirId | The dir id. |
System.String | newName | The new name. |