CKFinder 3 – ASP.NET Connector Documentation
IFile Interface Reference

A ResourceType based file interface. More...

Inheritance diagram for IFile:
INode IThumbnailedFile IImageFile

Public Member Functions

Task< IFileAutoRenameAsync (CancellationToken cancellationToken)
 Asynchronously does automatic file rename, such that no file with the same name exists in the ResourceType. More...
 
Task CopyAsync (IFile destinationFile, bool allowOverwrite, CancellationToken cancellationToken)
 Asynchronously copies file. More...
 
Task MoveAsync (IFile destinationFile, bool allowOverwrite, CancellationToken cancellationToken)
 Asynchronously moves file. More...
 
Task DeleteAsync (CancellationToken cancellationToken)
 Asynchronoulsy deletes file. More...
 
Task< bool > ExistsAsync (CancellationToken cancellationToken)
 Asynchronously checks if file exists. More...
 
Task< Stream > ReadAsync (CancellationToken cancellationToken)
 Asynchronously reads file content. More...
 
Task WriteAsync (Stream stream, CancellationToken cancellationToken)
 Asynchronously writes file content. More...
 
Task< FileInfo > GetFileInfoAsync (CancellationToken cancellationToken)
 Asynchronously gets file information. More...
 
Task< string > GetUrlAsync (CancellationToken cancellationToken)
 Asynchronously gets file url. More...
 
bool HasValidExtension ()
 Checks if the extension is valid on the ResourceType. More...
 
bool HasValidExtension (bool checkDoubleExtension)
 Checks if the extension is valid on the ResourceType. More...
 
bool IsHidden ()
 Checks if file is hidden on the ResourceType. More...
 
Task< string > GetHashAsync (CancellationToken cancellationToken)
 Asynchronously calculates file hash. More...
 

Properties

string Name [get]
 Gets the file name. More...
 
string Extension [get]
 Gets the file extension. More...
 
string NameWithoutExtension [get]
 Gets the file name without the extension. More...
 
string Path [get]
 Gets ResourceType relative path to the file. More...
 
string FullPath [get]
 Gets the absolute path to the file. More...
 
ResourceType ResourceType [get]
 Gets the ResourceType. More...
 
IFolder ParentFolder [get]
 Gets parent folder instance. More...
 

Detailed Description

A ResourceType based file interface.

Member Function Documentation

◆ AutoRenameAsync()

Task<IFile> AutoRenameAsync ( CancellationToken  cancellationToken)

Asynchronously does automatic file rename, such that no file with the same name exists in the ResourceType.

Parameters
cancellationTokenA cancellation token.
Returns
A renamed file.

◆ CopyAsync()

Task CopyAsync ( IFile  destinationFile,
bool  allowOverwrite,
CancellationToken  cancellationToken 
)

Asynchronously copies file.

Parameters
destinationFileA destination file.
allowOverwriteWhen true will try to overwrite existing files.
cancellationTokenA cancellation token.

◆ DeleteAsync()

Task DeleteAsync ( CancellationToken  cancellationToken)

Asynchronoulsy deletes file.

Parameters
cancellationTokenA cancellation token

◆ ExistsAsync()

Task<bool> ExistsAsync ( CancellationToken  cancellationToken)

Asynchronously checks if file exists.

Parameters
cancellationTokenA cancellation token.
Returns
True if file exists, false otherwise.

◆ GetFileInfoAsync()

Task<FileInfo> GetFileInfoAsync ( CancellationToken  cancellationToken)

Asynchronously gets file information.

Parameters
cancellationTokenA cancellation token.
Returns
A FileInfo structure.

◆ GetHashAsync()

Task<string> GetHashAsync ( CancellationToken  cancellationToken)

Asynchronously calculates file hash.

Parameters
cancellationTokenA cancellation token.
Returns
A file hash.

◆ GetUrlAsync()

Task<string> GetUrlAsync ( CancellationToken  cancellationToken)

Asynchronously gets file url.

If a file system should generate Proxy commands, a file url should be retreived with help of IProxyUrlGenerator.

Parameters
cancellationTokenA cancellation token.
Returns
A file url.

◆ HasValidExtension() [1/2]

bool HasValidExtension ( )

Checks if the extension is valid on the ResourceType.

Returns
True if extension is valid, false otherwise.

◆ HasValidExtension() [2/2]

bool HasValidExtension ( bool  checkDoubleExtension)

Checks if the extension is valid on the ResourceType.

Parameters
checkDoubleExtensionIf true the method will split file name by dot character and check each part beside the first one against valid extensions list.
Returns
True if extension is valid, false otherwise.

◆ IsHidden()

bool IsHidden ( )

Checks if file is hidden on the ResourceType.

Returns
True if file is hidden, false otherwise.

◆ MoveAsync()

Task MoveAsync ( IFile  destinationFile,
bool  allowOverwrite,
CancellationToken  cancellationToken 
)

Asynchronously moves file.

May be used for rename operation.

Parameters
destinationFileA destination file.
allowOverwriteWhen true will try to overwrite existing files.
cancellationTokenA cancellation token.

◆ ReadAsync()

Task<Stream> ReadAsync ( CancellationToken  cancellationToken)

Asynchronously reads file content.

Parameters
cancellationTokenA cancellation token.
Returns
A stream with file content.

◆ WriteAsync()

Task WriteAsync ( Stream  stream,
CancellationToken  cancellationToken 
)

Asynchronously writes file content.

Parameters
streamA stream with file content.
cancellationTokenA cancellation token.

Property Documentation

◆ Extension

string Extension
get

Gets the file extension.

◆ FullPath

string FullPath
get

Gets the absolute path to the file.

◆ Name

string Name
get

Gets the file name.

◆ NameWithoutExtension

string NameWithoutExtension
get

Gets the file name without the extension.

◆ ParentFolder

IFolder ParentFolder
get

Gets parent folder instance.

◆ Path

string Path
get

Gets ResourceType relative path to the file.

◆ ResourceType

ResourceType ResourceType
get

Gets the ResourceType.


The documentation for this interface was generated from the following file: