C# Class FileStore.FileStore

Afficher le fichier Open project: gratianlup/SecureDelete Class Usage Examples

Méthodes publiques

Свойство Type Description
Separators char[]
files StoreFile>.Dictionary

Méthodes publiques

Méthode 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

Méthode 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 méthode

Creates a file.
public CreateFile ( string path ) : StoreFile
path string The file path.
Résultat StoreFile

CreateFolder() public méthode

Creates a folder.
public CreateFolder ( string path ) : void
path string The path.
Résultat void

DeleteFile() public méthode

Deletes a file.
public DeleteFile ( string path ) : void
path string The file path.
Résultat void

DeleteFolder() public méthode

Deletes a folder.
public DeleteFolder ( string path ) : void
path string The folder path.
Résultat void

FileExists() public méthode

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

FileStore() public méthode

public FileStore ( ) : System
Résultat System

FindFile() public méthode

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.
Résultat StoreFile

FolderExists() public méthode

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

GetFile() public méthode

Gets the file extended information.
public GetFile ( string path ) : StoreFile
path string The file path.
Résultat StoreFile

GetFolderFiles() public méthode

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

GetFolderFilesEx() public méthode

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

GetSubfolders() public méthode

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

Load() public méthode

Loads the store from the specified path.
public Load ( string path ) : bool
path string The path.
Résultat bool

MoveFile() public méthode

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

MoveFolder() public méthode

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

ReadFile() public méthode

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

ReadFile() public méthode

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

Save() public méthode

Saves the store to the specified path.
public Save ( string path ) : bool
path string The path.
Résultat bool

WriteFile() public méthode

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
Résultat bool

WriteFile() public méthode

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
Résultat void

WriteFile() public méthode

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
Résultat void

Property Details

Separators public_oe property

public char[] Separators
Résultat char[]

files public_oe property

public Dictionary files
Résultat StoreFile>.Dictionary