Sitevision Developer
Log in

Log in

RESTApp resources

Static resources are stored in the /resource folder.

AppResource

The AppResource utility is used to access resources within a RESTApp. RESTApp resources are ONLY open to its enclosing RESTApp, i.e. its content cannot be extracted or downloaded elsewhere.

Resources can be accessed in three different ways, where pathToResource is the path to the file in the resource folder.

appResource.getContent(pathToResource)

Returns the resource as a UTF-8 based string.

appResource.getNode(pathToResource)

Returns the resource as a JCR Node (sv:image or sv:file).

appResource.getInputStream(pathToResource)

Returns the resource as a java.io.BufferedInputStream.

Did you find the content on this page useful?