function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SwarnaSwarna 

properties file

I need to access a value from outside the code, say from a .properties file stored as a static resource.

How to read the value from the static resource using Apex code?
sfdcfoxsfdcfox
There are no filesystem-type features right now (correct me if I am wrong), so you would have to either use a HTTP request to download the file and parse the data (or use the new XmlStream object), or create a custom object and place the configuration data in this custom object (the most usual method, actually). This works because Apex Code can ignore object and sharing access, and access data that ordinarily could not be accessed by the user triggering the code, without exposing that data to the user directly or even indirectly, depending on how the system is designed.