public boolean markAsSpam(final SlingHttpServletRequest request,final String id){
  boolean result=false;
  try {
    final ResourceResolver resolver=request.getResourceResolver();
    final Session session=resolver.adaptTo(Session.class);
    final Node node=session.getNodeByIdentifier(id);
    if (node != null) {
      final Resource resource=resolver.getResource(node.getPath());
      result=akismetService.submitSpam(resource);
    }
  }
 catch (  RepositoryException e) {
    LOGGER.error("Could not submit spam.",e);
  }
  return result;
}

public boolean markAsSpam ( final SlingHttpServletRequest request , final String id ) { boolean result = false ; try { final ResourceResolver resolver = request . getResourceResolver ( ) ; final Session session = resolver . adaptTo ( Session . class ) ; final Node node = session . getNodeByIdentifier ( id ) ; if ( node != null ) { final Resource resource = resolver . getResource ( node . getPath ( ) ) ; result = akismetService . submitSpam ( resource ) ; } } catch ( RepositoryException e ) { LOGGER . error ( "Could not submit spam." , e ) ; } return result ; }
mark comment as spam , submit it to akismet and delete it by setting it ' s display property to false .
