Property | Type | Description | |
---|---|---|---|
DefaultAutoExpireTime | System.TimeSpan |
Method | Description | |
---|---|---|
ClearTempFiles ( bool ignoreExpiry ) : void | ||
Delete ( string filePath ) : void |
Deletes a file.
|
|
Delete ( string filePath, DeleteType type ) : void |
Deletes, tries to delete or marks a file for deletion depending on type.
|
|
PurgeDirectory ( string directoryToClean, System.TimeSpan autoExpireTime, int maxFilesInDirectory, string checkFileName ) : void |
Clears a folder based on specified conditions If any errors occur during cleanup, this doesn't raise an exception and ignored. Other errors might raise an exception. As errors are ignored, method can't gurantee that less than specified number of files will be in the folder after it ends. |
|
PurgeDirectoryDefault ( string directoryToClean ) : void |
Clears a folder based on default conditions If any errors occur during cleanup, this doesn't raise an exception and ignored. Other errors might raise an exception. As errors are ignored, method can't gurantee that less than specified number of files will be in the folder after it ends. |
|
RandomFileCode ( ) : string |
Gets a 13 character random code that can be used safely in a filename
|
|
RegisterTempFile ( string filename, System.DateTime expiry, bool removeFolder ) : void | ||
TryDelete ( string filePath ) : void |
Tries to delete a file with given path.
|
|
TryDeleteMarkedFiles ( string path ) : void |
Tries to delete all files that is marked for deletion by TryDeleteOrMark in a folder.
|
|
TryDeleteOrMark ( string filePath ) : void |
Tries to delete a file or marks it for deletion by DeleteMarkedFiles method by creating a ".delete" file.
|
public static ClearTempFiles ( bool ignoreExpiry ) : void | ||
ignoreExpiry | bool | |
return | void |
public static Delete ( string filePath ) : void | ||
filePath | string | /// File to be deleted (can be null). |
return | void |
public static Delete ( string filePath, DeleteType type ) : void | ||
filePath | string | /// File to be deleted (can be null). |
type | DeleteType | /// Delete type. |
return | void |
public static PurgeDirectory ( string directoryToClean, System.TimeSpan autoExpireTime, int maxFilesInDirectory, string checkFileName ) : void | ||
directoryToClean | string | /// Folder to be cleared |
autoExpireTime | System.TimeSpan | /// Files with creation time older than this is deleted. If passed as 0, time /// based cleanup is skipped. |
maxFilesInDirectory | int | /// If more than this number of files exists, files will be deleted starting from /// oldest to newest. By passing 0, all files can be deleted. If passed as -1, /// file count based cleanup is skipped. |
checkFileName | string | /// Safety file to be checked. If it is specified and it doesn't exists, operation /// is aborted. |
return | void |
public static PurgeDirectoryDefault ( string directoryToClean ) : void | ||
directoryToClean | string | /// Folder to be cleared |
return | void |
public static RegisterTempFile ( string filename, System.DateTime expiry, bool removeFolder ) : void | ||
filename | string | |
expiry | System.DateTime | |
removeFolder | bool | |
return | void |
public static TryDelete ( string filePath ) : void | ||
filePath | string | /// File to be deleted (can be null). |
return | void |
public static TryDeleteMarkedFiles ( string path ) : void | ||
path | string | /// Path of marked files to be deleted |
return | void |
public static TryDeleteOrMark ( string filePath ) : void | ||
filePath | string | /// File to be deleted |
return | void |