Need help in getting the string[] values of node property??
for example I have a node image which has property "references" of type String[] . I need to get the first value of array.
Thanks
From the Node, you can get the references property. And then call getValues to the reference values. From there, just take the first. Something like
public String getFirstReference(Node node) throws RepositoryException {
Property references = node.getProperty("references");
Value[] values = references.getValues();
return values[0].getString();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With