C# 클래스 ScrewTurn.Wiki.FilesStorageProvider

Implements a Local Files Storage Provider.
상속: IFilesStorageProviderV30
파일 보기 프로젝트 열기: mono/ScrewTurnWiki 1 사용 예제들

공개 메소드들

메소드 설명
CreateDirectory ( string path, string name ) : bool

Creates a new Directory.

If path is "/my/directory" and name is "newdir", a new directory named "/my/directory/newdir" is created.

DeleteDirectory ( string fullPath ) : bool

Deletes a Directory and all of its content.

DeleteFile ( string fullName ) : bool

Deletes a File.

DeletePageAttachment ( System.PageInfo pageInfo, string name ) : bool

Deletes a Page Attachment.

GetFileDetails ( string fullName ) : FileDetails

Gets the details of a file.

GetPageAttachmentDetails ( System.PageInfo pageInfo, string name ) : FileDetails

Gets the details of a page attachment.

GetPagesWithAttachments ( ) : string[]

The the names of the pages with attachments.

Init ( IHostV30 host, string config ) : void

Initializes the Storage Provider.

ListDirectories ( string directory ) : string[]

Lists the Directories in the specified directory.

ListFiles ( string directory ) : string[]

Lists the Files in the specified Directory.

ListPageAttachments ( System.PageInfo pageInfo ) : string[]

Returns the names of the Attachments of a Page.

NotifyPageRenaming ( System.PageInfo oldPage, System.PageInfo newPage ) : void

Notifies to the Provider that a Page has been renamed.

RenameDirectory ( string oldFullPath, string newFullPath ) : bool

Renames or moves a Directory.

RenameFile ( string oldFullName, string newFullName ) : bool

Renames or moves a File.

RenamePageAttachment ( System.PageInfo pageInfo, string oldName, string newName ) : bool

Renames a Page Attachment.

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

Retrieves a File.

RetrievePageAttachment ( System.PageInfo pageInfo, string name, Stream destinationStream, bool countHit ) : bool

Retrieves a Page Attachment.

SetFileRetrievalCount ( string fullName, int count ) : void

Clears the number of times a file was retrieved.

SetPageAttachmentRetrievalCount ( System.PageInfo pageInfo, string name, int count ) : void

Set the number of times a page attachment was retrieved.

Shutdown ( ) : void

Method invoked on shutdown.

This method might not be invoked in some cases.

StoreFile ( string fullName, Stream sourceStream, bool overwrite ) : bool

Stores a file.

If overwrite is false and File already exists, the method returns false.

StorePageAttachment ( System.PageInfo pageInfo, string name, Stream sourceStream, bool overwrite ) : bool

Stores a Page Attachment.

If overwrite is false and Attachment already exists, the method returns false.

비공개 메소드들

메소드 설명
AddDownloadHit ( string itemName, string outputFile ) : void

Adds a download hit for the specified item in the specified output file.

BuildFullPath ( string partialPath ) : string

Builds a full path from a provider-specific partial path.

For example: if partialPath is "/my/directory", the method returns "C:\Inetpub\wwwroot\Wiki\public\Upload\my\directory", assuming the Wiki resides in "C:\Inetpub\wwwroot\Wiki".

BuildFullPathForAttachments ( string partialPath ) : string

Builds a full path from a provider-specific partial path.

For example: if partialPath is "/my/directory", the method returns "C:\Inetpub\wwwroot\Wiki\public\Attachments\my\directory", assuming the Wiki resides in "C:\Inetpub\wwwroot\Wiki".

CheckPath ( string path, string begin ) : string

Checks the path.

ClearDownloadHitsPartialMatch ( string itemName, string outputFile ) : void

Clears the download hits for the items that match itemName in the specified file.

GetFileRetrievalCount ( string fullName ) : int

Gets the number of times a file was retrieved.

GetFullPath ( string finalChunk ) : string
GetPageAttachmentDirectory ( System.PageInfo pageInfo ) : string

Gets the name of the Directory containing the Attachments of a Page.

GetPageAttachmentRetrievalCount ( System.PageInfo pageInfo, string name ) : int

Gets the number of times a page attachment was retrieved.

RenameDownloadHitsItem ( string oldItemName, string newItemName, string outputFile ) : void

Renames an item of the download count list in the specified file.

RenameDownloadHitsItemPartialMatch ( string oldItemName, string newItemName, string outputFile ) : void

Renames an item of the download count list in the specified file.

SetDownloadHits ( string itemName, string outputFile, int count ) : void

Sets the download hits for the specified item in the specified file.

StreamCopy ( Stream source, Stream destination ) : void

Copies data from a Stream to another.

메소드 상세

CreateDirectory() 공개 메소드

Creates a new Directory.
If path is "/my/directory" and name is "newdir", a new directory named "/my/directory/newdir" is created.
If or are null. If is empty or if the directory does not exist, or if the new directory already exists.
public CreateDirectory ( string path, string name ) : bool
path string The path to create the new Directory in.
name string The name of the new Directory.
리턴 bool

DeleteDirectory() 공개 메소드

Deletes a Directory and all of its content.
If is null. If is empty or if it equals '/' or it does not exist.
public DeleteDirectory ( string fullPath ) : bool
fullPath string The full path of the Directory.
리턴 bool

DeleteFile() 공개 메소드

Deletes a File.
If is null. If is empty or it does not exist.
public DeleteFile ( string fullName ) : bool
fullName string The full name of the File.
리턴 bool

DeletePageAttachment() 공개 메소드

Deletes a Page Attachment.
If or are null. If is empty or if the page or attachment do not exist.
public DeletePageAttachment ( System.PageInfo pageInfo, string name ) : bool
pageInfo System.PageInfo The Page Info that owns the Attachment.
name string The name of the Attachment, for example "myfile.jpg".
리턴 bool

GetFileDetails() 공개 메소드

Gets the details of a file.
If is null. If is empty.
public GetFileDetails ( string fullName ) : FileDetails
fullName string The full name of the file.
리턴 ScrewTurn.Wiki.PluginFramework.FileDetails

GetPageAttachmentDetails() 공개 메소드

Gets the details of a page attachment.
If or are null. If is empty.
public GetPageAttachmentDetails ( System.PageInfo pageInfo, string name ) : FileDetails
pageInfo System.PageInfo The page that owns the attachment.
name string The name of the attachment, for example "myfile.jpg".
리턴 ScrewTurn.Wiki.PluginFramework.FileDetails

GetPagesWithAttachments() 공개 메소드

The the names of the pages with attachments.
public GetPagesWithAttachments ( ) : string[]
리턴 string[]

Init() 공개 메소드

Initializes the Storage Provider.
If or are null. If is not valid or is incorrect.
public Init ( IHostV30 host, string config ) : void
host IHostV30 The Host of the Component.
config string The Configuration data, if any.
리턴 void

ListDirectories() 공개 메소드

Lists the Directories in the specified directory.
If does not exist.
public ListDirectories ( string directory ) : string[]
directory string The full directory name, for example "/my/directory". Null, empty or "/" for the root directory.
리턴 string[]

ListFiles() 공개 메소드

Lists the Files in the specified Directory.
If does not exist.
public ListFiles ( string directory ) : string[]
directory string The full directory name, for example "/my/directory". Null, empty or "/" for the root directory.
리턴 string[]

ListPageAttachments() 공개 메소드

Returns the names of the Attachments of a Page.
If is null.
public ListPageAttachments ( System.PageInfo pageInfo ) : string[]
pageInfo System.PageInfo The Page Info object that owns the Attachments.
리턴 string[]

NotifyPageRenaming() 공개 메소드

Notifies to the Provider that a Page has been renamed.
If or are null If the new page is already in use.
public NotifyPageRenaming ( System.PageInfo oldPage, System.PageInfo newPage ) : void
oldPage System.PageInfo The old Page Info object.
newPage System.PageInfo The new Page Info object.
리턴 void

RenameDirectory() 공개 메소드

Renames or moves a Directory.
If or are null. If or are empty or equal to '/', /// or if the old directory does not exist or the new directory already exists.
public RenameDirectory ( string oldFullPath, string newFullPath ) : bool
oldFullPath string The old full path of the Directory.
newFullPath string The new full path of the Directory.
리턴 bool

RenameFile() 공개 메소드

Renames or moves a File.
If or are null. If or are empty, or if the old file does not exist, or if the new file already exist.
public RenameFile ( string oldFullName, string newFullName ) : bool
oldFullName string The old full name of the File.
newFullName string The new full name of the File.
리턴 bool

RenamePageAttachment() 공개 메소드

Renames a Page Attachment.
If , or are null. If , or are empty, /// or if the page or old attachment do not exist, or the new attachment name already exists.
public RenamePageAttachment ( System.PageInfo pageInfo, string oldName, string newName ) : bool
pageInfo System.PageInfo The Page Info that owns the Attachment.
oldName string The old name of the Attachment.
newName string The new name of the Attachment.
리턴 bool

RetrieveFile() 공개 메소드

Retrieves a File.
If os are null. If is empty or does not support writing, or if does not exist.
public RetrieveFile ( string fullName, Stream destinationStream, bool countHit ) : bool
fullName string The full name of the File.
destinationStream Stream A Stream object used as destination of a byte stream, /// i.e. the method writes to the Stream the file content.
countHit bool A value indicating whether or not to count this retrieval in the statistics.
리턴 bool

RetrievePageAttachment() 공개 메소드

Retrieves a Page Attachment.
If , or are null. If is empty or if does not support writing, /// or if the page does not have attachments or if the attachment does not exist.
public RetrievePageAttachment ( System.PageInfo pageInfo, string name, Stream destinationStream, bool countHit ) : bool
pageInfo System.PageInfo The Page Info that owns the Attachment.
name string The name of the Attachment, for example "myfile.jpg".
destinationStream Stream A Stream object used as destination of a byte stream, /// i.e. the method writes to the Stream the file content.
countHit bool A value indicating whether or not to count this retrieval in the statistics.
리턴 bool

SetFileRetrievalCount() 공개 메소드

Clears the number of times a file was retrieved.
If is null. If is empty. If is less than zero.
public SetFileRetrievalCount ( string fullName, int count ) : void
fullName string The full name of the file.
count int The count to set.
리턴 void

SetPageAttachmentRetrievalCount() 공개 메소드

Set the number of times a page attachment was retrieved.
If or are null. If is empty. If is less than zero.
public SetPageAttachmentRetrievalCount ( System.PageInfo pageInfo, string name, int count ) : void
pageInfo System.PageInfo The page.
name string The name of the attachment.
count int The count to set.
리턴 void

Shutdown() 공개 메소드

Method invoked on shutdown.
This method might not be invoked in some cases.
public Shutdown ( ) : void
리턴 void

StoreFile() 공개 메소드

Stores a file.
If overwrite is false and File already exists, the method returns false.
If os are null. If is empty or does not support reading.
public StoreFile ( string fullName, Stream sourceStream, bool overwrite ) : bool
fullName string The full name of the file.
sourceStream Stream A Stream object used as source of a byte stream, /// i.e. the method reads from the Stream and stores the content properly.
overwrite bool true to overwrite an existing file.
리턴 bool

StorePageAttachment() 공개 메소드

Stores a Page Attachment.
If overwrite is false and Attachment already exists, the method returns false.
If , or are null. If is empty or if does not support reading.
public StorePageAttachment ( System.PageInfo pageInfo, string name, Stream sourceStream, bool overwrite ) : bool
pageInfo System.PageInfo The Page Info that owns the Attachment.
name string The name of the Attachment, for example "myfile.jpg".
sourceStream Stream A Stream object used as source of a byte stream, /// i.e. the method reads from the Stream and stores the content properly.
overwrite bool true to overwrite an existing Attachment.
리턴 bool