Class DatabaseFileProvider
public sealed class DatabaseFileProvider : VirtualFileProviderBase, IVirtualFileProvider, IDisposable
- Inheritance
-
DatabaseFileProvider
- Implements
- Inherited Members
- Extension Methods
Constructors
DatabaseFileProvider(IContentIndexMap, ObjectDatabase, string)
public DatabaseFileProvider(IContentIndexMap contentIndexMap, ObjectDatabase objectDatabase, string mountPoint = null)
Parameters
contentIndexMap
IContentIndexMapobjectDatabase
ObjectDatabasemountPoint
string
DatabaseFileProvider(ObjectDatabase, string)
public DatabaseFileProvider(ObjectDatabase objectDatabase, string mountPoint = null)
Parameters
objectDatabase
ObjectDatabasemountPoint
string
Fields
ObjectIdUrl
URL prefix for ObjectId references.
public static readonly string ObjectIdUrl
Field Value
Properties
ContentIndexMap
public IContentIndexMap ContentIndexMap { get; }
Property Value
ObjectDatabase
public ObjectDatabase ObjectDatabase { get; }
Property Value
Methods
CreateRegexForFileSearch(string, string, VirtualSearchOption)
public static Regex CreateRegexForFileSearch(string url, string searchPattern, VirtualSearchOption searchOption)
Parameters
url
stringsearchPattern
stringsearchOption
VirtualSearchOption
Returns
FileExists(string)
Determines whether the specified path points to an existing file.
public override bool FileExists(string url)
Parameters
url
stringThe path.
Returns
FileSize(string)
Returns the size of the specified file in bytes
public override long FileSize(string url)
Parameters
url
stringThe file or directory for which to obtain size
Returns
- long
A long value representing the file size in bytes
GetAbsolutePath(string)
Gets the absolute path for the specified local path from this provider.
public override string GetAbsolutePath(string url)
Parameters
url
string
Returns
- string
An absolute path.
ListFiles(string, string, VirtualSearchOption)
Returns the list of files from the specified path.
public override string[] ListFiles(string url, string searchPattern, VirtualSearchOption searchOption)
Parameters
url
stringThe url (without preceding slash).
searchPattern
stringThe search string to match against the names of files in
path
. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.searchOption
VirtualSearchOptionOne of the enumeration values that specifies whether the search operation should include all subdirectories or only the current directory.
Returns
- string[]
A list of files from the specified path
Remarks
Example: to get all files within a directory ListFiles("path/to/folder", "*", VirtualSearchOption.TopDirectoryOnly)
OpenStream(string, VirtualFileMode, VirtualFileAccess, VirtualFileShare, StreamFlags)
Opens a Stream from the specified path.
public override Stream OpenStream(string url, VirtualFileMode mode, VirtualFileAccess access, VirtualFileShare share = VirtualFileShare.Read, StreamFlags streamFlags = StreamFlags.None)
Parameters
url
stringmode
VirtualFileModeThe mode.
access
VirtualFileAccessThe access.
share
VirtualFileShareThe process sharing mode.
streamFlags
StreamFlagsThe type of stream needed
Returns
- Stream
The opened stream.
ResolveObjectId(string, out ObjectId)
Resolves the given VFS URL into a ObjectId and its DatabaseFileProvider.
public static DatabaseFileProvider ResolveObjectId(string url, out ObjectId objectId)
Parameters
Returns
- DatabaseFileProvider
The DatabaseFileProvider containing this object if it could be found; [null] otherwise.