C# Class MongoDB.GridFS.GridFileInfo

Provides instance methods for the creation, copying, deletion, moving, and opening of files, and aids in the creation of GridFileStream objects. The api is very similar to the FileInfo class in System.IO.
Afficher le fichier Open project: sdether/mongodb-csharp Class Usage Examples

Méthodes publiques

Méthode Description
CalcMD5 ( ) : string
Create ( ) : GridFileStream

Creates the file named FileName and returns the GridFileStream

Create ( FileMode mode ) : GridFileStream
Create ( FileMode mode, FileAccess access ) : GridFileStream
Delete ( ) : void

Permanently removes a file from the database.

GridFileInfo ( Database db, string filename ) : System
GridFileInfo ( Database db, string bucket, string filename ) : System
MoveTo ( String newFileName ) : void

Renames a file.

Open ( FileMode mode, FileAccess access ) : GridFileStream
OpenRead ( ) : GridFileStream

Creates a read-only GridFileStream to an existing file.

OpenWrite ( ) : GridFileStream

Creates a write-only GridFileStream to an existing file.

Refresh ( ) : void

Reloads the file information from the database.

The data in the database will not reflect any changes done through an open stream until it is closed.

ToDocument ( ) : Document
ToString ( ) : string
Truncate ( ) : void

Deletes all data in a file and sets the length to 0.

UpdateInfo ( ) : void

Updates the aliases, contentType, metadata and uploadDate in the database.

To rename a file use the MoveTo method.

Private Methods

Méthode Description
LoadFileData ( ) : void
SetFileDataDefaults ( string filename ) : void

Method Details

CalcMD5() public méthode

public CalcMD5 ( ) : string
Résultat string

Create() public méthode

Creates the file named FileName and returns the GridFileStream
If the file already exists
public Create ( ) : GridFileStream
Résultat GridFileStream

Create() public méthode

public Create ( FileMode mode ) : GridFileStream
mode FileMode
Résultat GridFileStream

Create() public méthode

public Create ( FileMode mode, FileAccess access ) : GridFileStream
mode FileMode
access FileAccess
Résultat GridFileStream

Delete() public méthode

Permanently removes a file from the database.
public Delete ( ) : void
Résultat void

GridFileInfo() public méthode

public GridFileInfo ( Database db, string filename ) : System
db MongoDB.Driver.Database
filename string
Résultat System

GridFileInfo() public méthode

public GridFileInfo ( Database db, string bucket, string filename ) : System
db MongoDB.Driver.Database
bucket string
filename string
Résultat System

MoveTo() public méthode

Renames a file.
public MoveTo ( String newFileName ) : void
newFileName String
Résultat void

Open() public méthode

public Open ( FileMode mode, FileAccess access ) : GridFileStream
mode FileMode
access FileAccess
Résultat GridFileStream

OpenRead() public méthode

Creates a read-only GridFileStream to an existing file.
public OpenRead ( ) : GridFileStream
Résultat GridFileStream

OpenWrite() public méthode

Creates a write-only GridFileStream to an existing file.
public OpenWrite ( ) : GridFileStream
Résultat GridFileStream

Refresh() public méthode

Reloads the file information from the database.
The data in the database will not reflect any changes done through an open stream until it is closed.
public Refresh ( ) : void
Résultat void

ToDocument() public méthode

public ToDocument ( ) : Document
Résultat MongoDB.Driver.Document

ToString() public méthode

public ToString ( ) : string
Résultat string

Truncate() public méthode

Deletes all data in a file and sets the length to 0.
public Truncate ( ) : void
Résultat void

UpdateInfo() public méthode

Updates the aliases, contentType, metadata and uploadDate in the database.
To rename a file use the MoveTo method.
public UpdateInfo ( ) : void
Résultat void