public boolean preValidateBugLinks ( final ContentSpec contentSpec ) { // If Bug Links are turned off then there isn't any need to validate them. if ( ! contentSpec . isInjectBugLinks ( ) ) { return true ; } final BugLinkOptions bugOptions ; final BugLinkType type ; if ( contentSpec . getBugLinks ( ) . equals ( BugLinkType . JIRA ) ) { type = BugLinkType . JIRA ; bugOptions = contentSpec . getJIRABugLinkOptions ( ) ; } else { type = BugLinkType . BUGZILLA ; bugOptions = contentSpec . getBugzillaBugLinkOptions ( ) ; } final BaseBugLinkStrategy bugLinkStrategy = BugLinkStrategyFactory . getInstance ( ) . create ( type , bugOptions . getBaseUrl ( ) ) ; // Validate the content in the bug options using the appropriate bug link strategy try { bugLinkStrategy . checkValidValues ( bugOptions ) ; } catch ( ValidationException e ) { final Throwable cause = ExceptionUtilities . getRootCause ( e ) ; log . error ( cause . getMessage ( ) ) ; return false ; } return true ; }
Validate the Bug Links MetaData for a Content Specification without doing any external calls .