Class PathUtils
Implements
Inherited Members
Namespace: DotNetNuke.Common.Utilities
Assembly: DotNetNuke.dll
Syntax
public class PathUtils : ComponentBase<IPathUtils, PathUtils>, IPathUtils
Methods
| Improve this Doc View SourceAddTrailingSlash(String)
Adds backslash to the specified source.
Declaration
public virtual string AddTrailingSlash(string source)
Parameters
Type | Name | Description |
---|---|---|
System.String | source | The source string to be modified. |
Returns
Type | Description |
---|---|
System.String | The original string plus a backslash. |
FormatFolderPath(String)
Formats the provided folder path by adding a slash if needed.
Declaration
public virtual string FormatFolderPath(string folderPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | folderPath | The folder path to format. |
Returns
Type | Description |
---|---|
System.String | The formatted path. |
GetPhysicalPath(Int32, String)
Gets the physical path for the specified relative path.
Declaration
public virtual string GetPhysicalPath(int portalID, string relativePath)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalID | |
System.String | relativePath |
Returns
Type | Description |
---|---|
System.String | The path. |
GetRelativePath(Int32, String)
Gets the relative path for the specified physical path.
Declaration
public virtual string GetRelativePath(int portalID, string physicalPath)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalID | |
System.String | physicalPath |
Returns
Type | Description |
---|---|
System.String | The path. |
GetRootFolderMapPath(Int32)
Gets the physical root folder path for the specified portal.
Declaration
public virtual string GetRootFolderMapPath(int portalID)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalID |
Returns
Type | Description |
---|---|
System.String | The path. |
GetUserFolderPath(UserInfo)
Gets the path to a user folder.
Declaration
public virtual string GetUserFolderPath(UserInfo user)
Parameters
Type | Name | Description |
---|---|---|
UserInfo | user | The user info. |
Returns
Type | Description |
---|---|
System.String | The path to a user folder. |
GetUserFolderPathElement(Int32, PathUtils.UserFolderElement)
Get elements from the user folder path.
Declaration
public virtual string GetUserFolderPathElement(int userID, PathUtils.UserFolderElement mode)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | userID | The user identifier. |
PathUtils.UserFolderElement | mode | The UserFolderElement to get. |
Returns
Type | Description |
---|---|
System.String | The element from the user folder path. |
IsDefaultProtectedPath(String)
Checks if a folder is a default protected folder.
Declaration
public virtual bool IsDefaultProtectedPath(string folderPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | folderPath | The folder path. |
Returns
Type | Description |
---|---|
System.Boolean | True if the folderPath is a default protected folder. False otherwise. |
MapPath(String)
The MapPath method maps the specified relative or virtual path to the corresponding physical directory on the server.
Declaration
public virtual string MapPath(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | Specifies the relative or virtual path to map to a physical directory. If Path starts with either a forward (/) or backward slash (), the MapPath method returns a path as if Path were a full, virtual path. If Path doesn't start with a slash, the MapPath method returns a path relative to the directory of the .asp file being processed. |
Returns
Type | Description |
---|---|
System.String | The physical path. |
Remarks
If path is a null reference (Nothing in Visual Basic), then the MapPath method returns the full physical path of the directory that contains the current application.
RemoveTrailingSlash(String)
Removes the trailing slash or backslash from the specified source.
Declaration
public virtual string RemoveTrailingSlash(string source)
Parameters
Type | Name | Description |
---|---|---|
System.String | source | The source string to be modified. |
Returns
Type | Description |
---|---|
System.String | The original string minus the trailing slash. |
StripFolderPath(String)
Strips the original path by removing starting 0 or 0\.
Declaration
public virtual string StripFolderPath(string originalPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | originalPath | The original path. |
Returns
Type | Description |
---|---|
System.String | The stripped path. |