Skip to content

Commit

Permalink
Add initialization for 'open_access_enabled' flag
Browse files Browse the repository at this point in the history
Implemented a @PostConstruct init method to parse and set the open_access_enabled flag. This ensures the flag reflects the correct boolean value based on the configured string.
  • Loading branch information
Gcolon021 committed Sep 16, 2024
1 parent b226bb8 commit 215736b
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import javax.ejb.Singleton;
import javax.enterprise.context.ApplicationScoped;
Expand All @@ -29,10 +30,18 @@ public class PicSureWarInit {
private String default_application_uuid;

@Resource(mappedName = "java:global/openAccessEnabled")
private String open_access_enabled_str;

private boolean open_access_enabled;

@Resource(mappedName = "java:global/openAccessValidateUrl")
private String open_access_validate_url;

@PostConstruct
public void init() {
this.open_access_enabled = Boolean.parseBoolean(open_access_enabled_str);
}

// to be able to pre modified
public static final ObjectMapper objectMapper = new ObjectMapper();

Expand Down

0 comments on commit 215736b

Please sign in to comment.