EntropyEngine::Networking::WebDAV::WebDAVFileSystemBackend
EntropyEngine::Networking::WebDAV::WebDAVFileSystemBackend
Section titled “EntropyEngine::Networking::WebDAV::WebDAVFileSystemBackend”Read-only VFS backend for WebDAV servers. More…
#include <WebDAVFileSystemBackend.h>
Inherits from EntropyEngine::Core::IO::IFileSystemBackend, EntropyEngine::Core::EntropyObject
Public Classes
Section titled “Public Classes”| Name | |
|---|---|
| struct | Config Backend configuration. |
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| virtual Core::IO::FileOperationHandle | writeLine(const std::string & path, size_t lineNumber, std::string_view line) override Line operations not supported. |
| virtual Core::IO::FileOperationHandle | writeFile(const std::string & path, std::span< const uint8_t > data, Core::IO::WriteOptions options ={}) override Write operations not supported (read-only backend). |
| Core::IO::FileOperationHandle | writeFile(const std::string & path, std::span< const uint8_t > data, const std::string & ifMatchETag) |
| virtual Core::IO::FileOperationHandle | readLine(const std::string & path, size_t lineNumber) override Line operations not supported. |
| Core::IO::FileOperationHandle | readFileIfNoneMatch(const std::string & path, const std::string & etag) |
| virtual Core::IO::FileOperationHandle | readFile(const std::string & path, Core::IO::ReadOptions options ={}) override Reads file via HTTP GET (supports Range header). |
| virtual std::unique_ptr< Core::IO::FileStream > | openStream(const std::string & path, Core::IO::StreamOptions options ={}) override Opens streaming read for large files. |
| virtual std::string | normalizeKey(const std::string & path) const override Path normalization for VFS locking (pass-through). |
| Core::IO::FileOperationHandle | move(const std::string & srcPath, const std::string & dstPath, bool overwrite =true, std::optional< std::string > ifMatchETag ={}) |
| virtual Core::IO::FileOperationHandle | listDirectory(const std::string & path, Core::IO::ListDirectoryOptions options ={}) override Lists directory contents via PROPFIND Depth:1. |
| virtual Core::IO::FileOperationHandle | getMetadata(const std::string & path) override Gets file/directory metadata via PROPFIND Depth:0. |
| virtual Core::IO::BackendCapabilities | getCapabilities() const override Gets backend capabilities. |
| virtual std::string | getBackendType() const override Gets backend type identifier. |
| virtual bool | exists(const std::string & path) override Checks if resource exists via PROPFIND Depth:0. |
| Core::IO::FileOperationHandle | deleteFileIfMatch(const std::string & path, const std::string & ifMatchETag) |
| virtual Core::IO::FileOperationHandle | deleteFile(const std::string & path) override Delete operations not supported (read-only backend). |
| virtual Core::IO::FileOperationHandle | createFile(const std::string & path) override Create operations not supported (read-only backend). |
| virtual Core::IO::FileOperationHandle | createDirectory(const std::string & path) override Create a directory via WebDAV MKCOL. |
| Core::IO::FileOperationHandle | copy(const std::string & srcPath, const std::string & dstPath, bool overwrite =true, bool depth0 =false) |
| WebDAVFileSystemBackend(Config cfg) Constructs WebDAV backend with HttpClient. |
Additional inherited members
Section titled “Additional inherited members”Public Classes inherited from EntropyEngine::Core::IO::IFileSystemBackend
| Name | |
|---|---|
| struct | AcquireWriteScopeResult Backend-specific primitive for write serialization. |
| struct | AcquireScopeOptions |
Public Functions inherited from EntropyEngine::Core::IO::IFileSystemBackend
| Name | |
|---|---|
| ~IFileSystemBackend() override =default | |
| void | setVirtualFileSystem(VirtualFileSystem * vfs) |
| virtual FileOperationHandle | removeDirectory(const std::string & path) Removes a directory at the given path. |
| virtual FileOperationHandle | moveFile(const std::string & src, const std::string & dst, bool overwriteExisting =false) |
| virtual FileOperationHandle | getMetadataBatch(const BatchMetadataOptions & options) |
| virtual FileOperationHandle | copyFile(const std::string & src, const std::string & dst, const CopyOptions & options ={}) |
| virtual const char * | className() const override Runtime class name for diagnostics and reflection. |
| virtual AcquireWriteScopeResult | acquireWriteScope(const std::string & path, AcquireScopeOptions options ={}) |
Protected Attributes inherited from EntropyEngine::Core::IO::IFileSystemBackend
| Name | |
|---|---|
| VirtualFileSystem * | _vfs |
Protected Classes inherited from EntropyEngine::Core::EntropyObject
| Name | |
|---|---|
| struct | HandleCore Optional handle identity stamped by an owner/registry. |
Public Functions inherited from EntropyEngine::Core::EntropyObject
| Name | |
|---|---|
| virtual | ~EntropyObject() =default |
| virtual const TypeSystem::TypeInfo * | typeInfo() const Optional richer type information; may be null. |
| bool | tryRetain() const Attempts to retain only if the object is still alive. |
| virtual std::string | toString() const Human-readable short string (class@ptr by default). |
| void | retain() const Increments the reference count. |
| void | release() const Decrements the reference count and deletes when it reaches zero. |
| uint32_t | refCount() const Current reference count (approximate under contention). |
| EntropyObject & | operator=(const EntropyObject & ) =delete |
| EntropyObject & | operator=(EntropyObject && ) =delete |
| bool | hasHandle() const |
| template <class OwnerT > OwnerT * | handleOwnerAs() const Returns the stamped owner pointer cast to the requested type. |
| const void * | handleOwner() const |
| uint32_t | handleIndex() const |
| uint64_t | handleId() const |
| uint32_t | handleGeneration() const |
| WeakControlBlock * | getWeakControlBlock() const Lazily retrieves or creates the weak control block. |
| virtual std::string | description() const Long-form description; defaults to toString(). |
| virtual std::string | debugString() const Debug-oriented string including refcount and handle when present. |
| virtual const char * | className() const Runtime class name for diagnostics and reflection. |
| virtual uint64_t | classHash() const Stable type hash for cross-language identification. |
| EntropyObject() =default | |
| EntropyObject(EntropyObject && ) =delete | |
| EntropyObject(const EntropyObject & ) =delete |
Protected Functions inherited from EntropyEngine::Core::EntropyObject
| Name | |
|---|---|
| void | _setHandleIdentity(void * owner, uint32_t index, uint32_t generation) |
| void | _clearHandleIdentity() |
Protected Attributes inherited from EntropyEngine::Core::EntropyObject
| Name | |
|---|---|
| std::atomic< WeakControlBlock * > | _weakBlock Lazily allocated control block for weak refs. |
| std::atomic< uint32_t > | _refCount Thread-safe retain/release counter. |
| struct EntropyEngine::Core::EntropyObject::HandleCore | _handle |
Friends inherited from EntropyEngine::Core::EntropyObject
| Name | |
|---|---|
| struct | HandleAccess |
Detailed Description
Section titled “Detailed Description”class EntropyEngine::Networking::WebDAV::WebDAVFileSystemBackend;Read-only VFS backend for WebDAV servers.
Implements IFileSystemBackend for remote WebDAV resources. Uses VirtualFileSystem::submit() to schedule async operations through the VFS WorkContractGroup (no custom threads). Supports connection pooling for concurrent HTTP requests.
Read Operations:
- readFile() - HTTP GET with optional Range header
- getMetadata() - WebDAV PROPFIND Depth:0
- listDirectory() - WebDAV PROPFIND Depth:1
- exists() - WebDAV PROPFIND Depth:0
- openStream() - Streaming GET for large files
Thread Safety: All methods are thread-safe. Concurrent operations are handled by the VFS WorkContractGroup and connection pool (if configured).
// Create backendWebDAVFileSystemBackend::Config cfg{ .scheme = "https", .host = "example.com", .baseUrl = "/dav"};auto backend = std::make_shared<WebDAVFileSystemBackend>(cfg);
// Mount in VFSvfs->mount("/remote", backend);
// Use via VFSauto fileHandle = vfs->createFileHandle("/remote/data.bin");auto readOp = fileHandle.read();readOp.wait();processData(readOp.bytes());Public Functions Documentation
Section titled “Public Functions Documentation”function writeLine
Section titled “function writeLine”virtual Core::IO::FileOperationHandle writeLine( const std::string & path, size_t lineNumber, std::string_view line) overrideLine operations not supported.
Return: Immediate failure handle
Reimplements: EntropyEngine::Core::IO::IFileSystemBackend::writeLine
function writeFile
Section titled “function writeFile”virtual Core::IO::FileOperationHandle writeFile( const std::string & path, std::span< const uint8_t > data, Core::IO::WriteOptions options ={}) overrideWrite operations not supported (read-only backend).
Return: Immediate failure handle
Reimplements: EntropyEngine::Core::IO::IFileSystemBackend::writeFile
function writeFile
Section titled “function writeFile”Core::IO::FileOperationHandle writeFile( const std::string & path, std::span< const uint8_t > data, const std::string & ifMatchETag)function readLine
Section titled “function readLine”virtual Core::IO::FileOperationHandle readLine( const std::string & path, size_t lineNumber) overrideLine operations not supported.
Return: Immediate failure handle
Reimplements: EntropyEngine::Core::IO::IFileSystemBackend::readLine
function readFileIfNoneMatch
Section titled “function readFileIfNoneMatch”Core::IO::FileOperationHandle readFileIfNoneMatch( const std::string & path, const std::string & etag)function readFile
Section titled “function readFile”virtual Core::IO::FileOperationHandle readFile( const std::string & path, Core::IO::ReadOptions options ={}) overrideReads file via HTTP GET (supports Range header).
Parameters:
- path VFS path (mapped to baseUrl + path)
- options Read options (offset, length for partial reads)
Return: FileOperationHandle that completes with file bytes
Reimplements: EntropyEngine::Core::IO::IFileSystemBackend::readFile
function openStream
Section titled “function openStream”virtual std::unique_ptr< Core::IO::FileStream > openStream( const std::string & path, Core::IO::StreamOptions options ={}) overrideOpens streaming read for large files.
Parameters:
- path VFS path
- options Stream options (mode must be Read, bufferSize configurable)
Return: FileStream for incremental reads, or nullptr if mode is not Read
Reimplements: EntropyEngine::Core::IO::IFileSystemBackend::openStream
function normalizeKey
Section titled “function normalizeKey”inline virtual std::string normalizeKey( const std::string & path) const overridePath normalization for VFS locking (pass-through).
Parameters:
- path Path to normalize
Return: Path unchanged (WebDAV paths are used as-is)
Reimplements: EntropyEngine::Core::IO::IFileSystemBackend::normalizeKey
function move
Section titled “function move”Core::IO::FileOperationHandle move( const std::string & srcPath, const std::string & dstPath, bool overwrite =true, std::optional< std::string > ifMatchETag ={})function listDirectory
Section titled “function listDirectory”virtual Core::IO::FileOperationHandle listDirectory( const std::string & path, Core::IO::ListDirectoryOptions options ={}) overrideLists directory contents via PROPFIND Depth:1.
Parameters:
- path VFS path to directory
- options Listing options (unused in current implementation)
Return: FileOperationHandle that completes with DirectoryEntry vector
Reimplements: EntropyEngine::Core::IO::IFileSystemBackend::listDirectory
function getMetadata
Section titled “function getMetadata”virtual Core::IO::FileOperationHandle getMetadata( const std::string & path) overrideGets file/directory metadata via PROPFIND Depth:0.
Parameters:
- path VFS path
Return: FileOperationHandle that completes with FileMetadata
Reimplements: EntropyEngine::Core::IO::IFileSystemBackend::getMetadata
function getCapabilities
Section titled “function getCapabilities”virtual Core::IO::BackendCapabilities getCapabilities() const overrideGets backend capabilities.
Return: Capabilities indicating read-only, streaming, remote backend
Reimplements: EntropyEngine::Core::IO::IFileSystemBackend::getCapabilities
function getBackendType
Section titled “function getBackendType”inline virtual std::string getBackendType() const overrideGets backend type identifier.
Return: “WebDAV”
Reimplements: EntropyEngine::Core::IO::IFileSystemBackend::getBackendType
function exists
Section titled “function exists”virtual bool exists( const std::string & path) overrideChecks if resource exists via PROPFIND Depth:0.
Parameters:
- path VFS path
Return: true if resource exists and is accessible
Reimplements: EntropyEngine::Core::IO::IFileSystemBackend::exists
function deleteFileIfMatch
Section titled “function deleteFileIfMatch”Core::IO::FileOperationHandle deleteFileIfMatch( const std::string & path, const std::string & ifMatchETag)function deleteFile
Section titled “function deleteFile”virtual Core::IO::FileOperationHandle deleteFile( const std::string & path) overrideDelete operations not supported (read-only backend).
Return: Immediate failure handle
Reimplements: EntropyEngine::Core::IO::IFileSystemBackend::deleteFile
function createFile
Section titled “function createFile”virtual Core::IO::FileOperationHandle createFile( const std::string & path) overrideCreate operations not supported (read-only backend).
Return: Immediate failure handle
Reimplements: EntropyEngine::Core::IO::IFileSystemBackend::createFile
function createDirectory
Section titled “function createDirectory”virtual Core::IO::FileOperationHandle createDirectory( const std::string & path) overrideCreate a directory via WebDAV MKCOL.
Parameters:
- path VFS path to directory to create (e.g., “/newdir/”)
Return: FileOperationHandle that completes with success on 201 and maps 405/409 appropriately
Reimplements: EntropyEngine::Core::IO::IFileSystemBackend::createDirectory
function copy
Section titled “function copy”Core::IO::FileOperationHandle copy( const std::string & srcPath, const std::string & dstPath, bool overwrite =true, bool depth0 =false)function WebDAVFileSystemBackend
Section titled “function WebDAVFileSystemBackend”inline explicit WebDAVFileSystemBackend( Config cfg)Constructs WebDAV backend with HttpClient.
Parameters:
- cfg Backend configuration (scheme, host, base URL)
Updated on 2026-01-26 at 16:50:32 -0500