cq5 - CQ - Check whether the resource object is valid -


i need check whether resource object valid or not below 'resource' object. example if pass url getresource("some path not available in cq") in case need restrict it

resource resource= resourceresolver.getresource(/content/rc/test/jcr:content"); node node = resource.adaptto(node.class); string parentpagepath= node.getproperty("someproperty").getvalue().getstring(); 

is there way do?

if using getresource null check sufficient. if use resolve, have use !resourceutil.isnonexistingresource(resource). on node level can check existence of property hasproperty.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

android - CollapsingToolbarLayout: position the ExpandedText programmatically -

Listeners to visualise results of load test in JMeter -