Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
1.2 KiB
Java
Raw Normal View History

New common module (#3573) # Description of Changes Introduced a new `common` module for shared libs and commonly used classes. See the screenshot below for the file structure and classes that have been moved. --- <img width="452" alt="Screenshot 2025-05-22 at 11 46 56" src="https://github.com/user-attachments/assets/c9badabc-48f9-4079-b83e-7cfde0fb840f" /> <img width="470" alt="Screenshot 2025-05-22 at 11 47 30" src="https://github.com/user-attachments/assets/e8315b09-2e78-4c50-b9de-4dd9b9b0ecb1" /> ## Checklist ### General - [x] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [x] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md) (if applicable) - [x] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md) (if applicable) - [x] I have performed a self-review of my own code - [x] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [x] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [x] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing) for more details.
2025-05-27 13:01:52 +01:00
package stirling.software.common.util;
2023-08-26 17:30:49 +01:00
import java.util.List;
public class PropertyConfigs {
public static boolean getBooleanValue(List<String> keys, boolean defaultValue) {
for (String key : keys) {
String value = System.getProperty(key);
if (value == null) value = System.getenv(key);
2023-12-30 19:11:27 +00:00
2023-08-26 17:30:49 +01:00
if (value != null) return Boolean.valueOf(value);
}
return defaultValue;
}
2023-12-30 19:11:27 +00:00
2023-08-26 17:30:49 +01:00
public static String getStringValue(List<String> keys, String defaultValue) {
for (String key : keys) {
String value = System.getProperty(key);
if (value == null) value = System.getenv(key);
2023-12-30 19:11:27 +00:00
2023-08-26 17:30:49 +01:00
if (value != null) return value;
}
return defaultValue;
}
2023-12-30 19:11:27 +00:00
2023-08-26 17:30:49 +01:00
public static boolean getBooleanValue(String key, boolean defaultValue) {
String value = System.getProperty(key);
if (value == null) value = System.getenv(key);
return (value != null) ? Boolean.valueOf(value) : defaultValue;
}
public static String getStringValue(String key, String defaultValue) {
String value = System.getProperty(key);
if (value == null) value = System.getenv(key);
return (value != null) ? value : defaultValue;
}
}