Skip to content

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

Name
structConfig
Backend configuration.
Name
virtual Core::IO::FileOperationHandlewriteLine(const std::string & path, size_t lineNumber, std::string_view line) override
Line operations not supported.
virtual Core::IO::FileOperationHandlewriteFile(const std::string & path, std::span< const uint8_t > data, Core::IO::WriteOptions options ={}) override
Write operations not supported (read-only backend).
Core::IO::FileOperationHandlewriteFile(const std::string & path, std::span< const uint8_t > data, const std::string & ifMatchETag)
virtual Core::IO::FileOperationHandlereadLine(const std::string & path, size_t lineNumber) override
Line operations not supported.
Core::IO::FileOperationHandlereadFileIfNoneMatch(const std::string & path, const std::string & etag)
virtual Core::IO::FileOperationHandlereadFile(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::stringnormalizeKey(const std::string & path) const override
Path normalization for VFS locking (pass-through).
Core::IO::FileOperationHandlemove(const std::string & srcPath, const std::string & dstPath, bool overwrite =true, std::optional< std::string > ifMatchETag ={})
virtual Core::IO::FileOperationHandlelistDirectory(const std::string & path, Core::IO::ListDirectoryOptions options ={}) override
Lists directory contents via PROPFIND Depth:1.
virtual Core::IO::FileOperationHandlegetMetadata(const std::string & path) override
Gets file/directory metadata via PROPFIND Depth:0.
virtual Core::IO::BackendCapabilitiesgetCapabilities() const override
Gets backend capabilities.
virtual std::stringgetBackendType() const override
Gets backend type identifier.
virtual boolexists(const std::string & path) override
Checks if resource exists via PROPFIND Depth:0.
Core::IO::FileOperationHandledeleteFileIfMatch(const std::string & path, const std::string & ifMatchETag)
virtual Core::IO::FileOperationHandledeleteFile(const std::string & path) override
Delete operations not supported (read-only backend).
virtual Core::IO::FileOperationHandlecreateFile(const std::string & path) override
Create operations not supported (read-only backend).
virtual Core::IO::FileOperationHandlecreateDirectory(const std::string & path) override
Create a directory via WebDAV MKCOL.
Core::IO::FileOperationHandlecopy(const std::string & srcPath, const std::string & dstPath, bool overwrite =true, bool depth0 =false)
WebDAVFileSystemBackend(Config cfg)
Constructs WebDAV backend with HttpClient.

Public Classes inherited from EntropyEngine::Core::IO::IFileSystemBackend

Name
structAcquireWriteScopeResult
Backend-specific primitive for write serialization.
structAcquireScopeOptions

Public Functions inherited from EntropyEngine::Core::IO::IFileSystemBackend

Name
~IFileSystemBackend() override =default
voidsetVirtualFileSystem(VirtualFileSystem * vfs)
virtual FileOperationHandleremoveDirectory(const std::string & path)
Removes a directory at the given path.
virtual FileOperationHandlemoveFile(const std::string & src, const std::string & dst, bool overwriteExisting =false)
virtual FileOperationHandlegetMetadataBatch(const BatchMetadataOptions & options)
virtual FileOperationHandlecopyFile(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 AcquireWriteScopeResultacquireWriteScope(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
structHandleCore
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.
booltryRetain() const
Attempts to retain only if the object is still alive.
virtual std::stringtoString() const
Human-readable short string (class@ptr by default).
voidretain() const
Increments the reference count.
voidrelease() const
Decrements the reference count and deletes when it reaches zero.
uint32_trefCount() const
Current reference count (approximate under contention).
EntropyObject &operator=(const EntropyObject & ) =delete
EntropyObject &operator=(EntropyObject && ) =delete
boolhasHandle() const
template <class OwnerT >
OwnerT *
handleOwnerAs() const
Returns the stamped owner pointer cast to the requested type.
const void *handleOwner() const
uint32_thandleIndex() const
uint64_thandleId() const
uint32_thandleGeneration() const
WeakControlBlock *getWeakControlBlock() const
Lazily retrieves or creates the weak control block.
virtual std::stringdescription() const
Long-form description; defaults to toString().
virtual std::stringdebugString() const
Debug-oriented string including refcount and handle when present.
virtual const char *className() const
Runtime class name for diagnostics and reflection.
virtual uint64_tclassHash() 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
structHandleAccess
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:

Thread Safety: All methods are thread-safe. Concurrent operations are handled by the VFS WorkContractGroup and connection pool (if configured).

// Create backend
WebDAVFileSystemBackend::Config cfg{
.scheme = "https",
.host = "example.com",
.baseUrl = "/dav"
};
auto backend = std::make_shared<WebDAVFileSystemBackend>(cfg);
// Mount in VFS
vfs->mount("/remote", backend);
// Use via VFS
auto fileHandle = vfs->createFileHandle("/remote/data.bin");
auto readOp = fileHandle.read();
readOp.wait();
processData(readOp.bytes());
virtual Core::IO::FileOperationHandle writeLine(
const std::string & path,
size_t lineNumber,
std::string_view line
) override

Line operations not supported.

Return: Immediate failure handle

Reimplements: EntropyEngine::Core::IO::IFileSystemBackend::writeLine

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).

Return: Immediate failure handle

Reimplements: EntropyEngine::Core::IO::IFileSystemBackend::writeFile

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.

Return: Immediate failure handle

Reimplements: EntropyEngine::Core::IO::IFileSystemBackend::readLine

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).

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

virtual std::unique_ptr< Core::IO::FileStream > openStream(
const std::string & path,
Core::IO::StreamOptions options ={}
) override

Opens 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

inline virtual std::string normalizeKey(
const std::string & path
) const override

Path 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

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.

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

virtual Core::IO::FileOperationHandle getMetadata(
const std::string & path
) override

Gets file/directory metadata via PROPFIND Depth:0.

Parameters:

  • path VFS path

Return: FileOperationHandle that completes with FileMetadata

Reimplements: EntropyEngine::Core::IO::IFileSystemBackend::getMetadata

virtual Core::IO::BackendCapabilities getCapabilities() const override

Gets backend capabilities.

Return: Capabilities indicating read-only, streaming, remote backend

Reimplements: EntropyEngine::Core::IO::IFileSystemBackend::getCapabilities

inline virtual std::string getBackendType() const override

Gets backend type identifier.

Return: “WebDAV”

Reimplements: EntropyEngine::Core::IO::IFileSystemBackend::getBackendType

virtual bool exists(
const std::string & path
) override

Checks 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

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).

Return: Immediate failure handle

Reimplements: EntropyEngine::Core::IO::IFileSystemBackend::deleteFile

virtual Core::IO::FileOperationHandle createFile(
const std::string & path
) override

Create operations not supported (read-only backend).

Return: Immediate failure handle

Reimplements: EntropyEngine::Core::IO::IFileSystemBackend::createFile

virtual Core::IO::FileOperationHandle createDirectory(
const std::string & path
) override

Create 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

Core::IO::FileOperationHandle copy(
const std::string & srcPath,
const std::string & dstPath,
bool overwrite =true,
bool depth0 =false
)
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