private String getSingleNotificationRESTUrl ( HttpServletRequest request , long id ) { String path = request . getContextPath ( ) + REQUEST_ROOT + id ; try { URL url = new URL ( request . getScheme ( ) , request . getServerName ( ) , request . getServerPort ( ) , path ) ; return url . toExternalForm ( ) ; } catch ( MalformedURLException e ) { // if it fails, just return a relative path. Not ideal, but better than nothing... log . warn ( "Error building Location header" , e ) ; return path ; } }
Build the URL for a specific notification .