public T find ( AbstractProject < ? , ? > project , Class < T > type ) { // First check that the Flexible Publish plugin is installed: if ( Jenkins . getInstance ( ) . getPlugin ( FLEXIBLE_PUBLISH_PLUGIN ) != null ) { // Iterate all the project's publishers and find the flexible publisher: for ( Publisher publisher : project . getPublishersList ( ) ) { // Found the flexible publisher: if ( publisher instanceof FlexiblePublisher ) { // See if it wraps a publisher of the specified type and if it does, return it: T pub = getWrappedPublisher ( publisher , type ) ; if ( pub != null ) { return pub ; } } } } return null ; }
Gets the publisher of the specified type if it is wrapped by the Flexible Publish publisher in a project . Null is returned if no such publisher is found .