C# Class FileStore.FileStore

Show file Open project: gratianlup/SecureDelete Class Usage Examples

Public Properties

Property Type Description
Separators char[]
files StoreFile>.Dictionary

Public Methods

Method Description
CreateFile ( string path ) : StoreFile

Creates a file.

CreateFolder ( string path ) : void

Creates a folder.

DeleteFile ( string path ) : void

Deletes a file.

DeleteFolder ( string path ) : void

Deletes a folder.

FileExists ( string path ) : bool

Checks if the given file exists.

FileStore ( ) : System
FindFile ( string path, string fileName, bool subfolders ) : StoreFile

Tries to locate the given file.

FolderExists ( string path ) : bool

Checks if the given folder exists.

GetFile ( string path ) : StoreFile

Gets the file extended information.

GetFolderFiles ( string path ) : string[]

Gets a string array of the files in the given folder.

GetFolderFilesEx ( string path ) : StoreFile[]

Gets a StoreFile array of the files in the given folder.

GetSubfolders ( string path ) : string[]

Gets a string array of the subfolders in the given folder.

Load ( string path ) : bool

Loads the store from the specified path.

MoveFile ( string sourcePath, string destinationPath ) : void

Moves a file.

MoveFolder ( string sourcePath, string destinationPath ) : void

Moves a folder.

ReadFile ( StoreFile file ) : byte[]

Get the contents of the given file.

ReadFile ( string path ) : byte[]

Get the contents of the given file.

Save ( string path ) : bool

Saves the store to the specified path.

WriteFile ( StoreFile file, string dataPath, StoreMode storeMode ) : bool

Stores the data contained in the given file into the file.

WriteFile ( StoreFile file, Stream stream, StoreMode storeMode ) : void

Stores the given data into the file.

WriteFile ( StoreFile file, byte data, StoreMode storeMode ) : void

Stores the given data into the file.

Private Methods

Method Description
CompressData ( byte data ) : byte[]
CreateFolderImpl ( string path ) : StoreFolder
DecompressData ( byte data ) : byte[]
DecryptData ( byte data ) : byte[]
DeserializeFolders ( byte data ) : bool
EncryptData ( byte data ) : byte[]
Format ( ) : void

Removes all files and folders from the store.

GetFileId ( string path ) : Guid?
GetFolder ( string path ) : StoreFolder
GetFolder ( string path, StoreFolder &parent ) : StoreFolder
InitEncryptionAlgorithm ( ) : void
SerializeFolders ( ) : MemoryStream
SetFileData ( StoreFile file, byte data, StoreMode storeMode ) : void

Method Details

CreateFile() public method

Creates a file.
public CreateFile ( string path ) : StoreFile
path string The file path.
return StoreFile

CreateFolder() public method

Creates a folder.
public CreateFolder ( string path ) : void
path string The path.
return void

DeleteFile() public method

Deletes a file.
public DeleteFile ( string path ) : void
path string The file path.
return void

DeleteFolder() public method

Deletes a folder.
public DeleteFolder ( string path ) : void
path string The folder path.
return void

FileExists() public method

Checks if the given file exists.
public FileExists ( string path ) : bool
path string The file path.
return bool

FileStore() public method

public FileStore ( ) : System
return System

FindFile() public method

Tries to locate the given file.
public FindFile ( string path, string fileName, bool subfolders ) : StoreFile
path string The folder from where to start searching.
fileName string Name of the file.
subfolders bool Search in subfolders.
return StoreFile

FolderExists() public method

Checks if the given folder exists.
public FolderExists ( string path ) : bool
path string The folder path.
return bool

GetFile() public method

Gets the file extended information.
public GetFile ( string path ) : StoreFile
path string The file path.
return StoreFile

GetFolderFiles() public method

Gets a string array of the files in the given folder.
public GetFolderFiles ( string path ) : string[]
path string The folder path.
return string[]

GetFolderFilesEx() public method

Gets a StoreFile array of the files in the given folder.
public GetFolderFilesEx ( string path ) : StoreFile[]
path string The folder path.
return StoreFile[]

GetSubfolders() public method

Gets a string array of the subfolders in the given folder.
public GetSubfolders ( string path ) : string[]
path string The folder path.
return string[]

Load() public method

Loads the store from the specified path.
public Load ( string path ) : bool
path string The path.
return bool

MoveFile() public method

Moves a file.
public MoveFile ( string sourcePath, string destinationPath ) : void
sourcePath string The source path.
destinationPath string The destination path.
return void

MoveFolder() public method

Moves a folder.
public MoveFolder ( string sourcePath, string destinationPath ) : void
sourcePath string The source path.
destinationPath string The destination path.
return void

ReadFile() public method

Get the contents of the given file.
public ReadFile ( StoreFile file ) : byte[]
file StoreFile The file from which to get the data.
return byte[]

ReadFile() public method

Get the contents of the given file.
public ReadFile ( string path ) : byte[]
path string
return byte[]

Save() public method

Saves the store to the specified path.
public Save ( string path ) : bool
path string The path.
return bool

WriteFile() public method

Stores the data contained in the given file into the file.
public WriteFile ( StoreFile file, string dataPath, StoreMode storeMode ) : bool
file StoreFile The file in which to store the data.
dataPath string
storeMode StoreMode
return bool

WriteFile() public method

Stores the given data into the file.
public WriteFile ( StoreFile file, Stream stream, StoreMode storeMode ) : void
file StoreFile The file in which to store the data.
stream Stream
storeMode StoreMode
return void

WriteFile() public method

Stores the given data into the file.
public WriteFile ( StoreFile file, byte data, StoreMode storeMode ) : void
file StoreFile The file in which to store the data.
data byte The data to store.
storeMode StoreMode
return void

Property Details

Separators public property

public char[] Separators
return char[]

files public property

public Dictionary files
return StoreFile>.Dictionary