Splitter row for debugging

This commit is contained in:
Luca Frosini 2024-11-04 14:41:56 +01:00
parent d4201c68c6
commit 84fbf0ea4e
1 changed files with 6 additions and 4 deletions

View File

@ -10,6 +10,7 @@ import org.gcube.com.fasterxml.jackson.databind.JsonMappingException;
import org.gcube.com.fasterxml.jackson.databind.JsonNode; import org.gcube.com.fasterxml.jackson.databind.JsonNode;
import org.gcube.com.fasterxml.jackson.databind.node.ObjectNode; import org.gcube.com.fasterxml.jackson.databind.node.ObjectNode;
import org.gcube.common.authorization.utils.manager.SecretManagerProvider; import org.gcube.common.authorization.utils.manager.SecretManagerProvider;
import org.gcube.common.authorization.utils.user.User;
import org.gcube.informationsystem.base.reference.Element; import org.gcube.informationsystem.base.reference.Element;
import org.gcube.informationsystem.base.reference.IdentifiableElement; import org.gcube.informationsystem.base.reference.IdentifiableElement;
import org.gcube.informationsystem.model.reference.properties.Metadata; import org.gcube.informationsystem.model.reference.properties.Metadata;
@ -29,13 +30,14 @@ public class MetadataUtility {
private static final Logger logger = LoggerFactory.getLogger(MetadataUtility.class); private static final Logger logger = LoggerFactory.getLogger(MetadataUtility.class);
public static String getUser() { public static String getUser() {
String user = Metadata.UNKNOWN_USER; String username = Metadata.UNKNOWN_USER;
try { try {
user = SecretManagerProvider.instance.get().getUser().getUsername(); User user = SecretManagerProvider.instance.get().getUser();
username = user.getUsername();
} catch(Exception e) { } catch(Exception e) {
logger.error("Unable to retrieve user. {} will be used", user); logger.error("Unable to retrieve user. {} will be used", username, e);
} }
return user; return username;
} }
public static Metadata createMetadata() { public static Metadata createMetadata() {