C# Class ScrewTurn.Wiki.Plugins.SqlCommon.SqlFilesStorageProviderBase

Implements a base class for a SQL files storage provider.
Inheritance: SqlStorageProviderBase, IFilesStorageProviderV30
Mostra file Open project: mono/ScrewTurnWiki

Public Methods

Method Description
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.

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 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, System destinationStream, bool countHit ) : bool

Retrieves a File.

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

Retrieves a Page Attachment.

SetFileRetrievalCount ( string fullName, int count ) : void

Sets the number of times a file was retrieved.

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

Sets the number of times a page attachment was retrieved.

StoreFile ( string fullName, System 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, System sourceStream, bool overwrite ) : bool

Stores a Page Attachment.

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

Private Methods

Method Description
AttachmentExists ( DbConnection connection, System.PageInfo page, string name ) : bool

Determines whether a page attachment exists.

AttachmentExists ( DbTransaction transaction, System.PageInfo page, string name ) : bool

Determines whether a page attachment exists.

DeleteDirectory ( DbTransaction transaction, string fullPath ) : bool

Deletes a directory and all its contents.

DirectoryExists ( DbConnection connection, string directory ) : bool

Determines whether a directory exists.

The root directory always exists.

DirectoryExists ( DbTransaction transaction, string directory ) : bool

Determines whether a directory exists.

The root directory always exists.

FileExists ( DbConnection connection, string fullName ) : bool

Determines whether a file exists.

FileExists ( DbTransaction transaction, string fullName ) : bool

Determines whether a file exists.

ListDirectories ( DbConnection connection, string directory ) : string[]

Lists the Directories in the specified directory.

ListDirectories ( DbTransaction transaction, string directory ) : string[]

Lists the Directories in the specified directory.

ListPageAttachments ( DbConnection connection, System.PageInfo pageInfo ) : string[]

Returns the names of the Attachments of a Page.

ListPageAttachments ( DbTransaction transaction, System.PageInfo pageInfo ) : string[]

Returns the names of the Attachments of a Page.

PrepareDirectory ( string directory ) : string

Prepares the directory name.

RenameDirectory ( DbTransaction transaction, string oldFullPath, string newFullPath ) : bool

Renames or moves a Directory.

SplitFileFullName ( string fullName, string &directory, string &file ) : void

Splits a file full name into the directory and file parts.

Method Details

CreateDirectory() public method

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.
return bool

DeleteDirectory() public method

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.
return bool

DeleteFile() public method

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.
return bool

DeletePageAttachment() public method

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".
return bool

GetFileDetails() public method

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.
return ScrewTurn.Wiki.PluginFramework.FileDetails

GetPageAttachmentDetails() public method

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".
return ScrewTurn.Wiki.PluginFramework.FileDetails

GetPagesWithAttachments() public method

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

ListDirectories() public method

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.
return string[]

ListFiles() public method

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.
return string[]

ListPageAttachments() public method

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.
return string[]

NotifyPageRenaming() public method

Notifies 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.
return void

RenameDirectory() public method

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.
return bool

RenameFile() public method

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.
return bool

RenamePageAttachment() public method

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.
return bool

RetrieveFile() public method

Retrieves a File.
If os are null. If is empty or does not support writing.
public RetrieveFile ( string fullName, System destinationStream, bool countHit ) : bool
fullName string The full name of the File.
destinationStream System 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.
return bool

RetrievePageAttachment() public method

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, System 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 System 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.
return bool

SetFileRetrievalCount() public method

Sets 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.
return void

SetPageAttachmentRetrievalCount() public method

Sets 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.
return void

StoreFile() public method

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, System sourceStream, bool overwrite ) : bool
fullName string The full name of the file.
sourceStream System 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.
return bool

StorePageAttachment() public method

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, System 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 System 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.
return bool