C# Class ScrewTurn.Wiki.FilesAndAttachments

Manages files, directories and attachments.
显示文件 Open project: mono/ScrewTurnWiki Class Usage Examples

Public Methods

Method Description
FindDirectoryProvider ( string fullPath ) : IFilesStorageProviderV30

Finds the provider that has a directory.

FindFileProvider ( string fullName ) : IFilesStorageProviderV30

Finds the provider that has a file.

FindPageAttachmentProvider ( System.PageInfo page, string attachmentName ) : IFilesStorageProviderV30

Finds the provider that has a page attachment.

GetFileDetails ( string fullName ) : FileDetails

Gets the details of a file.

GetPageAttachmentDetails ( System.PageInfo page, string attachmentName ) : FileDetails

Gets the details of a page attachment.

ListDirectories ( string fullPath ) : string[]

Lists the directories in a directory.

If the specified directory is the root, then the list is performed on all providers.

ListFiles ( string fullPath ) : string[]

Lists the files in a directory.

If the specified directory is the root, then the list is performed on all providers.

RetrieveFile ( string fullName, Stream output, bool countHit ) : bool

Retrieves a File.

RetrievePageAttachment ( System.PageInfo page, string attachmentName, Stream output, bool countHit ) : bool

Retrieves a Page Attachment.

Private Methods

Method Description
NormalizeFullName ( string fullName ) : string

Normalizes a full name.

NormalizeFullPath ( string fullPath ) : string

Normalizes a full path.

UpOneLevel ( string fullPath ) : string

Goes up one level in a directory path.

Method Details

FindDirectoryProvider() public static method

Finds the provider that has a directory.
public static FindDirectoryProvider ( string fullPath ) : IFilesStorageProviderV30
fullPath string The full path of the directory.
return IFilesStorageProviderV30

FindFileProvider() public static method

Finds the provider that has a file.
public static FindFileProvider ( string fullName ) : IFilesStorageProviderV30
fullName string The full name of the file.
return IFilesStorageProviderV30

FindPageAttachmentProvider() public static method

Finds the provider that has a page attachment.
public static FindPageAttachmentProvider ( System.PageInfo page, string attachmentName ) : IFilesStorageProviderV30
page System.PageInfo The page.
attachmentName string The name of the attachment.
return IFilesStorageProviderV30

GetFileDetails() public static method

Gets the details of a file.
public static GetFileDetails ( string fullName ) : FileDetails
fullName string The full name of the file.
return ScrewTurn.Wiki.PluginFramework.FileDetails

GetPageAttachmentDetails() public static method

Gets the details of a page attachment.
public static GetPageAttachmentDetails ( System.PageInfo page, string attachmentName ) : FileDetails
page System.PageInfo The page.
attachmentName string The name of the attachment.
return ScrewTurn.Wiki.PluginFramework.FileDetails

ListDirectories() public static method

Lists the directories in a directory.
If the specified directory is the root, then the list is performed on all providers.
public static ListDirectories ( string fullPath ) : string[]
fullPath string The full path.
return string[]

ListFiles() public static method

Lists the files in a directory.
If the specified directory is the root, then the list is performed on all providers.
public static ListFiles ( string fullPath ) : string[]
fullPath string The full path.
return string[]

RetrieveFile() public static method

Retrieves a File.
public static RetrieveFile ( string fullName, Stream output, bool countHit ) : bool
fullName string The full name of the File.
output Stream The output stream.
countHit bool A value indicating whether or not to count this retrieval in the statistics.
return bool

RetrievePageAttachment() public static method

Retrieves a Page Attachment.
public static RetrievePageAttachment ( System.PageInfo page, string attachmentName, Stream output, bool countHit ) : bool
page System.PageInfo The Page Info that owns the Attachment.
attachmentName string The name of the Attachment, for example "myfile.jpg".
output Stream The output stream.
countHit bool A value indicating whether or not to count this retrieval in the statistics.
return bool