code: public String getResourceExtension(Object obj) {
  
          String result;
          if (obj instanceof CmsResource) {
              result = CmsResource.getExtension(((CmsResource)obj).getRootPath());
          } else {
              result = CmsResource.getExtension(String.valueOf(obj));
          }
          return result;
      }
docs: Returns the resource name extension if present.<p>
  
  This assumes the parameter is either a CmsResource, or a String representing a resource name.</p>
  
  The extension will always be lower case.<p>
  
  @param obj a CmsResource or a String representing a resource name
  
  @return the extension or <code>null</code> if not available
  
  @see CmsResource#getExtension(String)
  @see org.opencms.jsp.CmsJspResourceWrapper#getResourceExtension()