org.apache.sling.sample.slingshot

## Class SlingshotUtil

- java.lang.Object
- - org.apache.sling.sample.slingshot.SlingshotUtil

    public abstract class SlingshotUtil
    extends Object

### Constructor Summary

Constructors
Constructor and Description
`SlingshotUtil()`

### Method Summary

All Methods Static Methods Concrete Methods
`static String` `getContentPath(org.apache.sling.api.resource.Resource resource)` Get the user content path for the resource
`static String` `getUserId(org.apache.sling.api.resource.Resource resource)` Get the user id for a resource
`static boolean` `isUser(org.apache.sling.api.SlingHttpServletRequest request)` Checks whether the request is from a known user or from anonymous

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### SlingshotUtil

    public SlingshotUtil()

### Method Detail

#### getUserId

    public static String getUserId(org.apache.sling.api.resource.Resource resource)

Get the user id for a resource

Parameters:
  `resource` - The resource of a user
Returns:
  The user id or `null`.

#### getContentPath

    public static String getContentPath(org.apache.sling.api.resource.Resource resource)

Get the user content path for the resource

Parameters:
  `resource` - The resource
Returns:
  The user content path or `null`.

#### isUser

    public static boolean isUser(org.apache.sling.api.SlingHttpServletRequest request)

Checks whether the request is from a known user or from anonymous

Parameters:
  `request` - The request
Returns:
  `true` if it is a known user.