Hi everyone,
i'm wondering if i can make a resource folder that will be created when the module is started to be reference to the material
What kind of resources/what's your ultimate goal?
The recommended pattern is to create a folder in the data directory (GatewayContext.getSystemManager().getDataDir()
, in the modules
folder, using your module's ID as the folder name. That folder will be retained in gateway backups (pretty sure) and can be safely used to store arbitrary resources.
I apologize for my delayed response; I appreciate your understanding.
I want to create a dedicated folder to store resources, such as images, for use in a Perspective component. For example, I would like to reference an image like this
/IgnitionProject
└──
├── Resources
│ └── img.png
├── anotherFolder
│ └── file.txt
└── ...
<img src="/system/Resources/img.png" alt="Image" />
Webdev module is not free module though, I suggest you to add a blob server by creating a module, that is how we did.
This is the module development category, so module-based solutions are implied. Any module can register a servlet class to offer arbitrary resources to web clients.
You don't even have to set up the servlet yourself.
Implement getMountedResourceFolder
on your GatewayModuleHook
and we'll automatically serve requests to a specific root URL path to a resource folder inside your module jar(s) in the appropriate scope.