Interface IFileVersionController
Do not implement. This interface is meant for reference and unit test purposes only. There is no guarantee that this interface will not change.
Namespace: DotNetNuke.Services.FileSystem
Assembly: DotNetNuke.dll
Syntax
public interface IFileVersionController
Methods
| Improve this Doc View SourceAddFileVersion(IFileInfo, Int32, Boolean, Boolean, Stream)
Add a new version of the file.
Declaration
string AddFileVersion(IFileInfo file, int userId, bool published = true, bool removeOldestVersions = true, Stream content = null)
Parameters
Type | Name | Description |
---|---|---|
IFileInfo | file | The file to add a version to. |
System.Int32 | userId | The user who is performing the operation. |
System.Boolean | published | Indicates if the new version should be the published version. |
System.Boolean | removeOldestVersions | Remove the oldest versions if # > MaxVersions. |
Stream | content | Version content. |
Returns
Type | Description |
---|---|
System.String | The name of the file where the content should be stored. |
DeleteAllUnpublishedVersions(IFileInfo, Boolean)
Deletes all the unpublished versions of a file.
Declaration
void DeleteAllUnpublishedVersions(IFileInfo file, bool resetPublishedVersionNumber)
Parameters
Type | Name | Description |
---|---|---|
IFileInfo | file | The file with versions. |
System.Boolean | resetPublishedVersionNumber | If True reset to 1 the PublishedVersion Property of the FileInfo. |
DeleteFileVersion(IFileInfo, Int32)
Deletes a version of a file. If the version to delete is the published version, the previous version gets published.
Declaration
int DeleteFileVersion(IFileInfo file, int version)
Parameters
Type | Name | Description |
---|---|---|
IFileInfo | file | The file to delete the version from. |
System.Int32 | version | The number of the version to delete. |
Returns
Type | Description |
---|---|
System.Int32 | The new published version. |
GetFileVersion(IFileInfo, Int32)
Gets the physical file with a specific version of a file.
Declaration
FileVersionInfo GetFileVersion(IFileInfo file, int version)
Parameters
Type | Name | Description |
---|---|---|
IFileInfo | file | The file to get the version from. |
System.Int32 | version | The number of the version to retrieve. |
Returns
Type | Description |
---|---|
FileVersionInfo | The version of the file. |
GetFileVersions(IFileInfo)
Returns all the versions of a file.
Declaration
IEnumerable<FileVersionInfo> GetFileVersions(IFileInfo file)
Parameters
Type | Name | Description |
---|---|---|
IFileInfo | file | The file with versions. |
Returns
Type | Description |
---|---|
IEnumerable<FileVersionInfo> | Collection of file versions. |
GetFileVersionsInFolder(Int32)
Get all the non-published versions in a Folder.
Declaration
IEnumerable<FileVersionInfo> GetFileVersionsInFolder(int folderId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | folderId | Folder Id. |
Returns
Type | Description |
---|---|
IEnumerable<FileVersionInfo> | Collection of file versions. |
GetVersionContent(IFileInfo, Int32)
Get the content of a specific version file.
Declaration
Stream GetVersionContent(IFileInfo file, int version)
Parameters
Type | Name | Description |
---|---|---|
IFileInfo | file | The file to get the version. |
System.Int32 | version | The version to obtain the content. |
Returns
Type | Description |
---|---|
Stream | The Stream with the file content. |
IsFileVersionEnabled(Int32)
This method returns true if FileVersion is enabled in the portal, false otherwise.
Declaration
bool IsFileVersionEnabled(int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | Portal Id. |
Returns
Type | Description |
---|---|
System.Boolean | true if FileVersion is enabled in the portal, false otherwise. |
IsFolderVersioned(IFolderInfo)
This method returns true if FileVersion is enabled in the Folder, false otherwise.
Declaration
bool IsFolderVersioned(IFolderInfo folder)
Parameters
Type | Name | Description |
---|---|---|
IFolderInfo | folder | FolderInfo object. |
Returns
Type | Description |
---|---|
System.Boolean | true if FileVersion is enabled in the Folder, false otherwise. |
IsFolderVersioned(Int32)
This method returns true if FileVersion is enabled in the Folder, false otherwise.
Declaration
bool IsFolderVersioned(int folderId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | folderId | Folder Id. |
Returns
Type | Description |
---|---|
System.Boolean | true if FileVersion is enabled in the Folder, false otherwise. |
MaxFileVersions(Int32)
This method returns the max number of versions for a portal.
Declaration
int MaxFileVersions(int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | Portal Id. |
Returns
Type | Description |
---|---|
System.Int32 | Max file versions. |
RollbackFileVersion(IFileInfo, Int32, Int32)
Rollbacks a file to the specified version.
Declaration
void RollbackFileVersion(IFileInfo file, int version, int userId)
Parameters
Type | Name | Description |
---|---|---|
IFileInfo | file | The file to perform the rollback. |
System.Int32 | version | The version to rollback to. |
System.Int32 | userId | The user who is performing the operation. |
SetPublishedVersion(IFileInfo, Int32)
Changes the published version of a file.
Declaration
void SetPublishedVersion(IFileInfo file, int version)
Parameters
Type | Name | Description |
---|---|---|
IFileInfo | file | The file to change its published version. |
System.Int32 | version | the version to change to. |