Class TempFileInfoProvider
- Namespace
- CMS.DataEngine
- Assembly
- CMS.DataEngine.dll
Class providing TempFileInfo management.
[ProviderInterface(typeof(ITempFileInfoProvider))]
public class TempFileInfoProvider : AbstractInfoProvider<TempFileInfo, TempFileInfoProvider>, IInfoProvider, ICustomizableProvider, IBulkOperationProvider, IWebFarmProvider, IInfoValidator<TempFileInfo>, IInfoByGuidProvider<TempFileInfo>, IInfoByNameProvider<TempFileInfo>, IBulkInfoProvider<TempFileInfo>, ITempFileInfoProvider, IInfoProvider<TempFileInfo>, IInfoByIdProvider<TempFileInfo>
- Inheritance
-
objectTempFileInfoProvider
- Implements
- Inherited Members
-
AbstractInfoProvider<TempFileInfo, TempFileInfoProvider, ObjectQuery<TempFileInfo>>.GetObjectQuery()
- Extension Methods
Constructors
TempFileInfoProvider()
public TempFileInfoProvider()
Fields
IMAGE_EDITOR_FOLDER
Name of the parent folder for image editor temporary files.
public const string IMAGE_EDITOR_FOLDER = "ImageEditor"
Field Value
- string
MULTIFILE_UPLOADER_FOLDER
Name of the parent folder for multifile uploader temporary files.
public const string MULTIFILE_UPLOADER_FOLDER = "MultiFileUploader"
Field Value
- string
Properties
TemporaryFilesFolderPath
Temporary files folder path (default: ~/App_Data/CMSTemp/)
public static string TemporaryFilesFolderPath { get; set; }
Property Value
- string
Methods
Delete(TempFileInfo)
Deletes the info object from the underlying data store.
public override void Delete(TempFileInfo info)
Parameters
infoTempFileInfoInfo object to be deleted.
Exceptions
- ArgumentNullException
Thrown when
infois null.
DeleteTempFiles(string, DateTime)
Deletes old temporary files from the specified parent folder.
public static void DeleteTempFiles(string parentFolder, DateTime olderThan)
Parameters
parentFolderstringParent folder which is located under the temporary files root folder
olderThanDateTimeAll temporary files older than this date/time are deleted
DeleteTempFiles(string, Guid)
Deletes all temporary files for the given parent scope.
public static void DeleteTempFiles(string parentFolder, Guid scopeGuid)
Parameters
parentFolderstringParent folder which is located under the temporary files root folder
scopeGuidGuidGUID of the parent scope
DeleteTempFiles(string, Guid, int, int)
Deletes all the temporary files with number between lower and upper bound for the given parent scope.
public static void DeleteTempFiles(string parentFolder, Guid scopeGuid, int lowerBound, int upperBound)
Parameters
parentFolderstringParent folder which is located under the temporary files root folder
scopeGuidGuidGUID of the parent scope
lowerBoundintNumber of the temporary file which should be deleted as the first
upperBoundintNumber of the temporary file which should be deleted as the last
DeleteTempFilesInternal(string, DateTime)
Deletes old temporary files from the specified parent folder.
protected virtual void DeleteTempFilesInternal(string parentFolder, DateTime olderThan)
Parameters
parentFolderstringParent folder which is located under the temporary files root folder
olderThanDateTimeAll temporary files older than this date/time are deleted
DeleteTempFilesInternal(string, Guid)
Deletes all the temporary files from the given parent scope.
protected virtual void DeleteTempFilesInternal(string parentFolder, Guid scopeGuid)
Parameters
parentFolderstringParent folder which is located under the temporary files root folder
scopeGuidGuidGUID of the parent scope
DeleteTempFilesInternal(string, Guid, int, int)
Deletes all the temporary files with number between lower and upper bound from the given parent scope.
protected virtual void DeleteTempFilesInternal(string parentFolder, Guid scopeGuid, int lowerBound, int upperBound)
Parameters
parentFolderstringParent folder which is located under the temporary files root folder
scopeGuidGuidGUID of the parent scope
lowerBoundintNumber of temporary file which should be deleted as the first
upperBoundintNumber of the temporary file which should be deleted as the last
EnsurePhysicalFile(TempFileInfo)
Ensures the file in the file system.
public static void EnsurePhysicalFile(TempFileInfo fileInfo)
Parameters
fileInfoTempFileInfoTemporary file
GetTempFileBinary(string, Guid, int, string)
Returns the temporary file binary data from disk.
public static byte[] GetTempFileBinary(string parentFolder, Guid scopeGuid, int fileNumber, string fileExtension)
Parameters
parentFolderstringParent folder which is located under the temporary files root folder
scopeGuidGuidGUID of the parent scope
fileNumberintTemporary file number
fileExtensionstringTemporary file extension
Returns
- byte[]
GetTempFileBinary(string, string, int, string)
Returns the temporary file binary data from disk.
public static byte[] GetTempFileBinary(string parentFolder, string scopeFolder, int fileNumber, string fileExtension)
Parameters
parentFolderstringParent folder which is located under the temporary files root folder
scopeFolderstringScope folder which is located under the parent folder
fileNumberintTemporary file number
fileExtensionstringTemporary file extension
Returns
- byte[]
GetTempFileInfo(Guid, int)
Returns temporary file with specified number.
public static TempFileInfo GetTempFileInfo(Guid scopeGuid, int number)
Parameters
scopeGuidGuidGUID of the parent scope
numberintTemporary file number within the parent scope
Returns
GetTempFileInfoInternal(Guid, int)
Returns temporary file from the specified parent scope and with specified number.
protected virtual TempFileInfo GetTempFileInfoInternal(Guid scopeGuid, int number)
Parameters
scopeGuidGuidGUID of the parent scope
numberintNumber of the temporary file to return
Returns
GetTempFilePath(string, Guid, int, string)
Returns physical path to the specified temporary file.
public static string GetTempFilePath(string parentFolder, Guid scopeGuid, int fileNumber, string fileExtension)
Parameters
parentFolderstringParent folder which is located under the temporary files root folder
scopeGuidGuidGUID of the parent scope
fileNumberintTemporary file number
fileExtensionstringTemporary file extension
Returns
- string
GetTempFilePath(string, string, int, string)
Returns physical path to the specified temporary file.
public static string GetTempFilePath(string parentFolder, string scopeFolder, int fileNumber, string fileExtension)
Parameters
parentFolderstringParent folder which is located under the temporary files root folder
scopeFolderstringScope folder which is located under the parent folder
fileNumberintTemporary file number
fileExtensionstringTemporary file extension
Returns
- string
GetTempFilesFolderPath(string, Guid)
Returns physical path to the folder where temporary files are located.
public static string GetTempFilesFolderPath(string parentFolder, Guid scopeGuid)
Parameters
parentFolderstringParent folder which is located under the temporary files root folder
scopeGuidGuidParent scope GUID
Returns
- string
GetTempFilesFolderPath(string, string)
Returns physical path to the folder where temporary files are located.
public static string GetTempFilesFolderPath(string parentFolder, string scopeFolder)
Parameters
parentFolderstringParent folder which is located under the temporary files root folder
scopeFolderstringScope folder which is located under the parent folder
Returns
- string
GetTempFilesRootFolderPath()
Returns physical path to the root folder of all temporary files.
public static string GetTempFilesRootFolderPath()
Returns
- string
GetTempFilesRootFolderPath(string)
Returns physical path to the root folder of all temporary files.
public static string GetTempFilesRootFolderPath(string webFullPath)
Parameters
webFullPathstringFull path to the root of the web project (e.g. c:\WebProject)
Returns
- string
Set(TempFileInfo)
Inserts or updates the info object in the underlying data store.
public override void Set(TempFileInfo info)
Parameters
infoTempFileInfoInfo object to be inserted or updated.
Exceptions
- ArgumentNullException
Thrown when
infois null.