C# 클래스 Serenity.IO.TemporaryFileHelper

Contains helper functions for temporary files and folders
파일 보기 프로젝트 열기: volkanceylan/Serenity

공개 프로퍼티들

프로퍼티 타입 설명
DefaultAutoExpireTime System.TimeSpan

공개 메소드들

메소드 설명
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.

메소드 상세

ClearTempFiles() 공개 정적인 메소드

public static ClearTempFiles ( bool ignoreExpiry ) : void
ignoreExpiry bool
리턴 void

Delete() 공개 정적인 메소드

Deletes a file.
public static Delete ( string filePath ) : void
filePath string /// File to be deleted (can be null).
리턴 void

Delete() 공개 정적인 메소드

Deletes, tries to delete or marks a file for deletion depending on type.
public static Delete ( string filePath, DeleteType type ) : void
filePath string /// File to be deleted (can be null).
type DeleteType /// Delete type.
리턴 void

PurgeDirectory() 공개 정적인 메소드

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.
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.
리턴 void

PurgeDirectoryDefault() 공개 정적인 메소드

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.
public static PurgeDirectoryDefault ( string directoryToClean ) : void
directoryToClean string /// Folder to be cleared
리턴 void

RandomFileCode() 공개 정적인 메소드

Gets a 13 character random code that can be used safely in a filename
public static RandomFileCode ( ) : string
리턴 string

RegisterTempFile() 공개 정적인 메소드

public static RegisterTempFile ( string filename, System.DateTime expiry, bool removeFolder ) : void
filename string
expiry System.DateTime
removeFolder bool
리턴 void

TryDelete() 공개 정적인 메소드

Tries to delete a file with given path.
public static TryDelete ( string filePath ) : void
filePath string /// File to be deleted (can be null).
리턴 void

TryDeleteMarkedFiles() 공개 정적인 메소드

Tries to delete all files that is marked for deletion by TryDeleteOrMark in a folder.
public static TryDeleteMarkedFiles ( string path ) : void
path string /// Path of marked files to be deleted
리턴 void

TryDeleteOrMark() 공개 정적인 메소드

Tries to delete a file or marks it for deletion by DeleteMarkedFiles method by creating a ".delete" file.
public static TryDeleteOrMark ( string filePath ) : void
filePath string /// File to be deleted
리턴 void

프로퍼티 상세

DefaultAutoExpireTime 공개적으로 정적으로 프로퍼티

By default, files older than 1 hour is cleared
public static TimeSpan,System DefaultAutoExpireTime
리턴 System.TimeSpan