public static Resource getResource ( Object adaptable ) { if ( adaptable instanceof Resource ) { return ( Resource ) adaptable ; } else if ( adaptable instanceof SlingHttpServletRequest ) { SlingHttpServletRequest request = ( SlingHttpServletRequest ) adaptable ; return request . getResource ( ) ; } return null ; }
Tries to get the resource associated with the adaptable .