https://linen.dev logo
#help
Title
# help
a

Amit Rawat

11/22/2023, 2:30 PM
Hello WireMock Community, I'm currently working on a project where I'm trying to use a database as the primary source for storing mappings and files, rather than relying on the filesystem. I've successfully managed to store mappings by implementing the 'MappingSource' interface. However, I'm encountering some challenges with storing files in the database. I came across the 'FileSource' interface, which seems like it should meet my needs. But upon delving into the code, I discovered dependencies related to 'BlobStoreFileSource' that have added to my confusion. Could anyone please provide some guidance or insights on how to effectively source files from a database using WireMock? Any advice or pointers to relevant documentation or examples would be greatly appreciated. Thanks in advance for your help!
t

Tom

11/22/2023, 3:21 PM
The way to do this is to create your own implementation of the
Stores
interface and set this on WireMock’s config at startup.
The
FileSource
interface is now just a wrapper around
BlobStore
so provided you implement this the way you want, the internal instances of
FileSource
will back onto whatever store you implemented.
Please note that these interfaces are in beta so might change a bit between versions
a

Amit Rawat

11/23/2023, 1:15 AM
Thanks @Tom for your inputs.
2 Views