Getting all resources of a model

Hi!

This question will probably sound really weird but I’m trying to understand if I can use Blender for a very specific use case.
I need to know if I can get the paths of all files referenced by an imported model.
Let’s say that I import an OBJ file that references a MTL file, that can also reference an image file. In this case, from this imported OBJ, I need to know the paths of both the material and the texture file. Is this possible?

I was thinking about it and I would not want to limit this just to materials and textures. I need to get all referenced resource files from a model, whatever they might be (feel free to let me know what else I should look for).

Any suggestions would be greatly appreciated,
Thanks!