• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CeON / dataverse / 1363

13 May 2024 08:49AM UTC coverage: 25.179% (-0.004%) from 25.183%
1363

push

jenkins

web-flow
Closes #2468: Clean-up empty working directories during clear step (#2471)

1 of 15 new or added lines in 2 files covered. (6.67%)

165 existing lines in 5 files now uncovered.

17523 of 69594 relevant lines covered (25.18%)

0.25 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

4.76
/dataverse-webapp/src/main/java/edu/harvard/iq/dataverse/util/SystemConfig.java
1
package edu.harvard.iq.dataverse.util;
2

3
import edu.harvard.iq.dataverse.authorization.providers.oauth2.DevOAuthAccountType;
4
import edu.harvard.iq.dataverse.common.BundleUtil;
5
import edu.harvard.iq.dataverse.settings.SettingsServiceBean;
6
import edu.harvard.iq.dataverse.settings.SettingsServiceBean.Key;
7
import io.vavr.Tuple;
8
import io.vavr.Tuple2;
9
import io.vavr.control.Try;
10
import org.apache.commons.lang.StringUtils;
11
import org.apache.commons.lang3.math.NumberUtils;
12
import org.json.JSONArray;
13
import org.json.JSONObject;
14

15
import javax.ejb.Stateless;
16
import javax.inject.Inject;
17
import javax.inject.Named;
18
import java.net.MalformedURLException;
19
import java.net.URL;
20
import java.util.Arrays;
21
import java.util.LinkedHashMap;
22
import java.util.Locale;
23
import java.util.Map;
24
import java.util.Properties;
25
import java.util.logging.Logger;
26

27
/**
28
 * System-wide configuration
29
 */
30
@Stateless
31
@Named
32
public class SystemConfig {
1✔
33

34
    private static final Logger logger = Logger.getLogger(SystemConfig.class.getCanonicalName());
1✔
35

36
    private static final String VERSION_PROPERTIES_CLASSPATH = "/config/version.properties";
37
    private static final String VERSION_PROPERTIES_KEY = "dataverse.version";
38
    private static final String VERSION_COMMIT_ID = "git.commit.id.full";
39
    private static final String VERSION_PLACEHOLDER = "${project.version}";
40
    private static final String VERSION_FALLBACK = "4.0";
41

42
    public static final String DATAVERSE_PATH = "/dataverse/";
43

44
    /**
45
     * A JVM option for where files are stored on the file system.
46
     */
47
    public static final String FILES_DIRECTORY = "dataverse.files.directory";
48

49
    @Inject
50
    private SettingsServiceBean settingsService;
51

52

53
    private static String appVersionWithBuild = null;
1✔
54
    private static String appVersion = null;
1✔
55

56
    public String getVersionWithBuild() {
57

58
        if (appVersionWithBuild == null) {
×
59

60
            // We'll rely on Maven placing the version number into the
61
            // version.properties file using resource filtering
62

63
            Try<Tuple2<String, String>> appVersionTry = Try
×
64
                    .withResources(() -> getClass().getResourceAsStream(VERSION_PROPERTIES_CLASSPATH))
×
65
                    .of(is -> {
×
66
                        Properties properties = new Properties();
×
67
                        properties.load(is);
×
68
                        return properties;
×
69
                    })
70
                    .map(p -> Tuple.of(p.getProperty(VERSION_PROPERTIES_KEY), p.getProperty(VERSION_COMMIT_ID)));
×
71

72
            if (appVersionTry.isFailure()) {
×
73
                appVersionWithBuild = VERSION_FALLBACK;
×
74
                logger.warning("Failed to read the " + VERSION_PROPERTIES_CLASSPATH + " file");
×
75

76
            } else if (StringUtils.equals(appVersionTry.get()._1(), VERSION_PLACEHOLDER)) {
×
77
                appVersionWithBuild = VERSION_FALLBACK;
×
78
                logger.warning(VERSION_PROPERTIES_CLASSPATH + " was not filtered by maven (check your pom.xml configuration)");
×
79

80
            } else {
81
                appVersionWithBuild = appVersionTry.get()._1() + "-" + appVersionTry.get()._2();
×
82
            }
83
        }
84

85
        return appVersionWithBuild;
×
86
    }
87

88
    public String getVersion() {
89

90
        if (appVersion == null) {
×
91
            Try<String> appVersionTry = Try
×
92
                    .withResources(() -> getClass().getResourceAsStream(VERSION_PROPERTIES_CLASSPATH))
×
93
                    .of(is -> {
×
94
                        Properties properties = new Properties();
×
95
                        properties.load(is);
×
96
                        return properties;
×
97
                    })
98
                    .map(p -> p.getProperty(VERSION_PROPERTIES_KEY));
×
99

100
            if (appVersionTry.isFailure()) {
×
101
                appVersion = VERSION_FALLBACK;
×
102
                logger.warning("Failed to read the " + VERSION_PROPERTIES_CLASSPATH + " file");
×
103

104
            } else if (StringUtils.equals(appVersionTry.get(), VERSION_PLACEHOLDER)) {
×
105
                appVersion = VERSION_FALLBACK;
×
106
                logger.warning(VERSION_PROPERTIES_CLASSPATH + " was not filtered by maven (check your pom.xml configuration)");
×
107

108
            } else {
109
                appVersion = appVersionTry.get();
×
110
            }
111
        }
112

113
        return appVersion;
×
114
    }
115

116
    public int getMinutesUntilPasswordResetTokenExpires() {
117
        return settingsService.getValueForKeyAsInt(SettingsServiceBean.Key.MinutesUntilPasswordResetTokenExpires);
×
118
    }
119

120
    public String getDataverseSiteUrl() {
121
        return settingsService.getValueForKey(SettingsServiceBean.Key.SiteUrl);
1✔
122
    }
123

124
    public boolean isReadonlyMode() {
125
        return settingsService.isTrueForKey(SettingsServiceBean.Key.ReadonlyMode);
×
126
    }
127

128
    public boolean isUnconfirmedMailRestrictionModeEnabled() {
129
        return settingsService.isTrueForKey(Key.UnconfirmedMailRestrictionModeEnabled);
×
130
    }
131

132
    public boolean isSignupAllowed() {
133
        if (isReadonlyMode()) {
×
134
            return false;
×
135
        }
136
        return settingsService.isTrueForKey(SettingsServiceBean.Key.AllowSignUp);
×
137
    }
138

139
    public String getFilesDirectory() {
140
        return getFilesDirectoryStatic();
×
141
    }
142

143
    public static String getFilesDirectoryStatic() {
144
        String filesDirectory = System.getProperty(SystemConfig.FILES_DIRECTORY);
1✔
145
        if (StringUtils.isEmpty(filesDirectory)) {
1✔
146
            filesDirectory = "/tmp/files";
1✔
147
        }
148
        return filesDirectory;
1✔
149
    }
150

151
    /**
152
     * The "official" server's fully-qualified domain name:
153
     */
154
    public String getDataverseServer() {
155
        try {
156
            return new URL(settingsService.getValueForKey(SettingsServiceBean.Key.SiteUrl)).getHost();
1✔
157
        } catch (MalformedURLException e) {
×
158
            e.printStackTrace();
×
159
            return "localhost";
×
160
        }
161
    }
162

163
    public String getSiteName(Locale locale) {
164
        return getLocalizedProperty(Key.SiteName, locale);
×
165
    }
166

167
    public String getSiteFullName(Locale locale) {
168
        return getLocalizedProperty(Key.SiteFullName, locale);
×
169
    }
170

171
    public boolean isSuperiorLogoDefined(Locale locale) {
172
        return !getLocalizedProperty(Key.SuperiorLogoPath, locale).isEmpty() || !getLocalizedProperty(Key.SuperiorLogoResponsivePath, locale).isEmpty();
×
173
    }
174

175
    public String getSuperiorLogoLink(Locale locale) {
176
        return getLocalizedProperty(Key.SuperiorLogoLink, locale);
×
177
    }
178

179
    public String getSuperiorLogoPath(Locale locale) {
180
        return getLocalizedProperty(Key.SuperiorLogoPath, locale);
×
181
    }
182

183
    public String getSuperiorLogoResponsivePath(Locale locale) {
184
        return getLocalizedProperty(Key.SuperiorLogoResponsivePath, locale);
×
185
    }
186

187
    public String getSuperiorLogoContrastPath(Locale locale) {
188
        return getLocalizedProperty(Key.SuperiorLogoContrastPath, locale);
×
189
    }
190

191
    public String getSuperiorLogoContrastResponsivePath(Locale locale) {
192
        return getLocalizedProperty(Key.SuperiorLogoContrastResponsivePath, locale);
×
193
    }
194

195
    public String getSuperiorLogoAlt(Locale locale) {
196
        return getLocalizedProperty(Key.SuperiorLogoAlt, locale);
×
197
    }
198

199
    public String getGuidesBaseUrl(Locale locale) {
200
        String guidesBaseUrl = settingsService.getValueForKey(SettingsServiceBean.Key.GuidesBaseUrl);
×
201
        return guidesBaseUrl + "/" + locale;
×
202
    }
203

204
    public String getGuidesVersion() {
205
        String guidesVersion = settingsService.getValueForKey(SettingsServiceBean.Key.GuidesVersion);
×
206

207
        return guidesVersion.equals(StringUtils.EMPTY) ? getVersion() : guidesVersion;
×
208
    }
209

210
    public boolean isRserveConfigured() {
211
        return settingsService.isTrueForKey(SettingsServiceBean.Key.RserveConfigured);
×
212
    }
213

214
    public long getUploadLogoSizeLimit() {
215
        return 500000;
×
216
    }
217

218
    // TODO: (?)
219
    // create sensible defaults for these things? -- 4.2.2
220
    public long getThumbnailSizeLimitImage() {
221
        return getThumbnailSizeLimit("Image");
×
222
    }
223

224
    public long getThumbnailSizeLimitPDF() {
225
        return getThumbnailSizeLimit("PDF");
×
226
    }
227

228
    private long getThumbnailSizeLimit(String type) {
229
        if (isReadonlyMode()) {
×
230
            return -1;
×
231
        }
232
        String option = null;
×
233

234
        //get options via jvm options
235

236
        if ("Image".equals(type)) {
×
237
            option = System.getProperty("dataverse.dataAccess.thumbnail.image.limit");
×
238
        } else if ("PDF".equals(type)) {
×
239
            option = System.getProperty("dataverse.dataAccess.thumbnail.pdf.limit");
×
240
        }
241

242
        return NumberUtils.toLong(option, 10_000_000);
×
243
    }
244

245
    private boolean isThumbnailGenerationDisabledForType(String type) {
246
        return getThumbnailSizeLimit(type) == -1l;
×
247
    }
248

249
    public boolean isThumbnailGenerationDisabledForImages() {
250
        return isThumbnailGenerationDisabledForType("Image");
×
251
    }
252

253
    public boolean isThumbnailGenerationDisabledForPDF() {
254
        return isThumbnailGenerationDisabledForType("PDF");
×
255
    }
256

257
    public String getApplicationTermsOfUse(Locale locale) {
258
        return getFromBundleIfEmptyLocalizedProperty(SettingsServiceBean.Key.ApplicationTermsOfUse, locale, "system.app.terms");
×
259
    }
260

261
    public String getApiTermsOfUse() {
262
        return getFromBundleIfEmptyProperty(SettingsServiceBean.Key.ApiTermsOfUse, "system.api.terms");
×
263
    }
264

265
    public String getPrivacyPolicy(Locale locale) {
266
        return getFromBundleIfEmptyLocalizedProperty(SettingsServiceBean.Key.PrivacyPolicy, locale, "system.privacy.policy");
×
267
    }
268

269
    public String getAccessibilityStatement(Locale locale) {
270
        return getFromBundleIfEmptyLocalizedProperty(Key.AccessibilityStatement, locale, "system.accessibility.statement");
×
271
    }
272

273
    public String getLoginInfo(Locale locale) {
274
        return getLocalizedProperty(SettingsServiceBean.Key.LoginInfo, locale);
×
275
    }
276

277
    public String getSelectDataverseInfo(Locale locale) {
UNCOV
278
        return getLocalizedProperty(SettingsServiceBean.Key.SelectDataverseInfo, locale);
×
279
    }
280

281
    public long getTabularIngestSizeLimit() {
282
        // This method will return the blanket ingestable size limit, if
283
        // set on the system. I.e., the universal limit that applies to all
284
        // tabular ingests, regardless of fromat:
UNCOV
285
        return settingsService.getValueForKeyAsLong(SettingsServiceBean.Key.TabularIngestSizeLimit);
×
286
    }
287

288
    public long getTabularIngestSizeLimit(String formatName) {
289
        // This method returns the size limit set specifically for this format name,
290
        // if available, otherwise - the blanket limit that applies to all tabular
291
        // ingests regardless of a format.
292

293
        if (StringUtils.isEmpty(formatName)) {
×
UNCOV
294
            return getTabularIngestSizeLimit();
×
295
        }
296

297
        String limitEntry = settingsService.get(SettingsServiceBean.Key.TabularIngestSizeLimit.toString() + ":" + formatName);
×
298

299
        if (StringUtils.isNotEmpty(limitEntry)) {
×
300
            try {
UNCOV
301
                Long sizeOption = new Long(limitEntry);
×
UNCOV
302
                return sizeOption;
×
UNCOV
303
            } catch (NumberFormatException nfe) {
×
304
                logger.warning("Invalid value for TabularIngestSizeLimit:" + formatName + "? - " + limitEntry);
×
305
            }
306
        }
307

308
        return getTabularIngestSizeLimit();
×
309
    }
310

311
    public boolean isTimerServer() {
312
        return settingsService.isTrueForKey(SettingsServiceBean.Key.TimerServer);
×
313
    }
314

315
    public DevOAuthAccountType getDevOAuthAccountType() {
UNCOV
316
        DevOAuthAccountType saneDefault = DevOAuthAccountType.PRODUCTION;
×
317
        String settingReturned = settingsService.getValueForKey(SettingsServiceBean.Key.DebugOAuthAccountType);
×
318
        logger.fine("setting returned: " + settingReturned);
×
319
        if (StringUtils.isNotEmpty(settingReturned)) {
×
320
            try {
321
                DevOAuthAccountType parsedValue = DevOAuthAccountType.valueOf(settingReturned);
×
UNCOV
322
                return parsedValue;
×
UNCOV
323
            } catch (IllegalArgumentException ex) {
×
324
                logger.info("Couldn't parse value: " + ex + " - returning a sane default: " + saneDefault);
×
325
                return saneDefault;
×
326
            }
327
        } else {
UNCOV
328
            logger.fine("OAuth dev mode has not been configured. Returning a sane default: " + saneDefault);
×
UNCOV
329
            return saneDefault;
×
330
        }
331
    }
332

333
    public String getOAuth2CallbackUrl() {
334
        String saneDefault = getDataverseSiteUrl() + "/oauth2/callback.xhtml";
×
UNCOV
335
        String settingReturned = settingsService.getValueForKey(SettingsServiceBean.Key.OAuth2CallbackUrl);
×
336
        logger.fine("getOAuth2CallbackUrl setting returned: " + settingReturned);
×
UNCOV
337
        if (StringUtils.isNotEmpty(settingReturned)) {
×
UNCOV
338
            return settingReturned;
×
339
        }
UNCOV
340
        return saneDefault;
×
341
    }
342

343
    /**
344
     * Below are three related enums having to do with big data support:
345
     * <p>
346
     * - FileUploadMethods
347
     * <p>
348
     * - FileDownloadMethods
349
     * <p>
350
     * - TransferProtocols
351
     * <p>
352
     * There is a good chance these will be consolidated in the future.
353
     */
UNCOV
354
    public enum FileUploadMethods {
×
355

356
        /**
357
         * DCM stands for Data Capture Module. Right now it supports upload over
358
         * rsync+ssh but DCM may support additional methods in the future.
359
         */
UNCOV
360
        RSYNC("dcm/rsync+ssh"),
×
361
        /**
362
         * Traditional Dataverse file handling, which tends to involve users
363
         * uploading and downloading files using a browser or APIs.
364
         */
UNCOV
365
        NATIVE("native/http");
×
366

367

368
        private final String text;
369

UNCOV
370
        FileUploadMethods(final String text) {
×
371
            this.text = text;
×
372
        }
×
373

374
        public static FileUploadMethods fromString(String text) {
UNCOV
375
            if (text != null) {
×
UNCOV
376
                for (FileUploadMethods fileUploadMethods : FileUploadMethods.values()) {
×
UNCOV
377
                    if (text.equals(fileUploadMethods.text)) {
×
378
                        return fileUploadMethods;
×
379
                    }
380
                }
381
            }
UNCOV
382
            throw new IllegalArgumentException("FileUploadMethods must be one of these values: " + Arrays.asList(FileUploadMethods
×
UNCOV
383
                                                                                                                         .values()) + ".");
×
384
        }
385

386
        @Override
387
        public String toString() {
UNCOV
388
            return text;
×
389
        }
390

391

392
    }
393

394
    /**
395
     * See FileUploadMethods.
396
     * <p>
397
     * TODO: Consider if dataverse.files.s3-download-redirect belongs here since
398
     * it's a way to bypass Glassfish when downloading.
399
     */
UNCOV
400
    public enum FileDownloadMethods {
×
401
        /**
402
         * RSAL stands for Repository Storage Abstraction Layer. Downloads don't
403
         * go through Glassfish.
404
         */
405
        RSYNC("rsal/rsync"),
×
406
        NATIVE("native/http");
×
407
        private final String text;
408

UNCOV
409
        FileDownloadMethods(final String text) {
×
410
            this.text = text;
×
411
        }
×
412

413
        public static FileUploadMethods fromString(String text) {
UNCOV
414
            if (text != null) {
×
UNCOV
415
                for (FileUploadMethods fileUploadMethods : FileUploadMethods.values()) {
×
UNCOV
416
                    if (text.equals(fileUploadMethods.text)) {
×
417
                        return fileUploadMethods;
×
418
                    }
419
                }
420
            }
UNCOV
421
            throw new IllegalArgumentException("FileDownloadMethods must be one of these values: " + Arrays.asList(FileDownloadMethods
×
UNCOV
422
                                                                                                                           .values()) + ".");
×
423
        }
424

425
        @Override
426
        public String toString() {
UNCOV
427
            return text;
×
428
        }
429

430
    }
431

UNCOV
432
    public enum DataFilePIDFormat {
×
UNCOV
433
        DEPENDENT("DEPENDENT"),
×
434
        INDEPENDENT("INDEPENDENT");
×
435
        private final String text;
436

437
        public String getText() {
438
            return text;
×
439
        }
440

UNCOV
441
        DataFilePIDFormat(final String text) {
×
UNCOV
442
            this.text = text;
×
443
        }
×
444

445
        @Override
446
        public String toString() {
UNCOV
447
            return text;
×
448
        }
449

450
    }
451

452
    /**
453
     * See FileUploadMethods.
454
     */
UNCOV
455
    public enum TransferProtocols {
×
456

UNCOV
457
        RSYNC("rsync"),
×
458
        /**
459
         * POSIX includes NFS. This is related to Key.LocalDataAccessPath in
460
         * SettingsServiceBean.
461
         */
UNCOV
462
        POSIX("posix"),
×
463
        GLOBUS("globus");
×
464

465
        private final String text;
466

UNCOV
467
        TransferProtocols(final String text) {
×
468
            this.text = text;
×
469
        }
×
470

471
        public static TransferProtocols fromString(String text) {
UNCOV
472
            if (text != null) {
×
UNCOV
473
                for (TransferProtocols transferProtocols : TransferProtocols.values()) {
×
UNCOV
474
                    if (text.equals(transferProtocols.text)) {
×
475
                        return transferProtocols;
×
476
                    }
477
                }
478
            }
UNCOV
479
            throw new IllegalArgumentException("TransferProtocols must be one of these values: " + Arrays.asList(TransferProtocols
×
UNCOV
480
                                                                                                                         .values()) + ".");
×
481
        }
482

483
        @Override
484
        public String toString() {
UNCOV
485
            return text;
×
486
        }
487

488
    }
489

490
    public boolean isRsyncUpload() {
UNCOV
491
        return getUploadMethodAvailable(SystemConfig.FileUploadMethods.RSYNC.toString());
×
492
    }
493

494
    // Controls if HTTP upload is enabled for both GUI and API.
495
    public boolean isHTTPUpload() {
496
        return getUploadMethodAvailable(SystemConfig.FileUploadMethods.NATIVE.toString());
×
497
    }
498

499
    public boolean isRsyncOnly() {
500
        String downloadMethods = settingsService.getValueForKey(SettingsServiceBean.Key.DownloadMethods);
×
501
        if (StringUtils.isEmpty(downloadMethods)) {
×
UNCOV
502
            return false;
×
503
        }
504
        if (!downloadMethods.toLowerCase().equals(SystemConfig.FileDownloadMethods.RSYNC.toString())) {
×
505
            return false;
×
506
        }
507
        String uploadMethods = settingsService.getValueForKey(SettingsServiceBean.Key.UploadMethods);
×
508
        if (StringUtils.isEmpty(uploadMethods)) {
×
509
            return false;
×
510
        } else {
UNCOV
511
            return Arrays.asList(uploadMethods.toLowerCase().split("\\s*,\\s*")).size() == 1 && uploadMethods
×
UNCOV
512
                    .toLowerCase()
×
UNCOV
513
                    .equals(SystemConfig.FileUploadMethods.RSYNC.toString());
×
514
        }
515
    }
516

517
    public boolean isRsyncDownload() {
UNCOV
518
        String downloadMethods = settingsService.getValueForKey(SettingsServiceBean.Key.DownloadMethods);
×
UNCOV
519
        return downloadMethods != null && downloadMethods
×
UNCOV
520
                .toLowerCase()
×
521
                .contains(SystemConfig.FileDownloadMethods.RSYNC.toString());
×
522
    }
523

524
    public boolean isHTTPDownload() {
525
        String downloadMethods = settingsService.getValueForKey(SettingsServiceBean.Key.DownloadMethods);
×
UNCOV
526
        logger.fine("Download Methods:" + downloadMethods);
×
UNCOV
527
        return downloadMethods != null && downloadMethods
×
UNCOV
528
                .toLowerCase()
×
529
                .contains(SystemConfig.FileDownloadMethods.NATIVE.toString());
×
530
    }
531

532
    private Boolean getUploadMethodAvailable(String method) {
533
        String uploadMethods = settingsService.getValueForKey(SettingsServiceBean.Key.UploadMethods);
×
UNCOV
534
        if (StringUtils.isEmpty(uploadMethods)) {
×
UNCOV
535
            return false;
×
536
        } else {
UNCOV
537
            return Arrays.asList(uploadMethods.toLowerCase().split("\\s*,\\s*")).contains(method);
×
538
        }
539
    }
540

541
    public Integer getUploadMethodCount() {
542
        String uploadMethods = settingsService.getValueForKey(SettingsServiceBean.Key.UploadMethods);
×
UNCOV
543
        if (StringUtils.isEmpty(uploadMethods)) {
×
UNCOV
544
            return 0;
×
545
        } else {
UNCOV
546
            return Arrays.asList(uploadMethods.toLowerCase().split("\\s*,\\s*")).size();
×
547
        }
548
    }
549

550
    public Map<String, String> getConfiguredLocales() {
551
        Map<String, String> configuredLocales = new LinkedHashMap<>();
×
552

553
        JSONArray entries = new JSONArray(settingsService.getValueForKey(SettingsServiceBean.Key.Languages));
×
UNCOV
554
        for (Object obj : entries) {
×
555
            JSONObject entry = (JSONObject) obj;
×
556
            String locale = entry.getString("locale");
×
UNCOV
557
            String title = entry.getString("title");
×
558

UNCOV
559
            configuredLocales.put(locale, title);
×
UNCOV
560
        }
×
561

562
        return configuredLocales;
×
563
    }
564

565
    public boolean isShowPrivacyPolicyFooterLinkRendered() {
566
        return settingsService.isTrueForKey(Key.ShowPrivacyPolicyFooterLink);
×
567
    }
568

569
    public boolean isShowTermsOfUseFooterLinkRendered() {
570
        return settingsService.isTrueForKey(Key.ShowTermsOfUseFooterLink);
×
571
    }
572

573
    public boolean isShowAccessibilityStatementFooterLinkRendered() {
574
        return settingsService.isTrueForKey(Key.ShowAccessibilityStatementFooterLink);
×
575
    }
576

577
    private String getFromBundleIfEmptyLocalizedProperty(Key key, Locale locale, String bundleKey) {
UNCOV
578
        String result = getLocalizedProperty(key, locale);
×
579

580
        return result.isEmpty() ? getFromBundleIfEmptyProperty(key, bundleKey) : result;
×
581
    }
582

583
    private String getFromBundleIfEmptyProperty(SettingsServiceBean.Key key, String bundleKey) {
UNCOV
584
        String result = settingsService.getValueForKey(key);
×
585

586
        return result.equals(StringUtils.EMPTY) ? BundleUtil.getStringFromBundle(bundleKey) : result;
×
587
    }
588

589
    private String getLocalizedProperty(Key key, Locale locale) {
UNCOV
590
        String result = settingsService.getValueForKeyWithPostfix(key, locale.toLanguageTag());
×
591

UNCOV
592
        return result.isEmpty() ? settingsService.getValueForKey(key) : result;
×
593
    }
594

595
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc