private ResourceReference parseURILinks ( String rawLink ) { ResourceReference result = null ; int uriSchemeDelimiterPos = rawLink . indexOf ( ' ' ) ; if ( uriSchemeDelimiterPos > - 1 ) { String scheme = rawLink . substring ( 0 , uriSchemeDelimiterPos ) ; String reference = rawLink . substring ( uriSchemeDelimiterPos + 1 ) ; if ( getAllowedURIPrefixes ( ) . contains ( scheme ) ) { try { ResourceReferenceTypeParser parser = this . componentManagerProvider . get ( ) . getInstance ( ResourceReferenceTypeParser . class , scheme ) ; ResourceReference resourceReference = parser . parse ( reference ) ; if ( resourceReference != null ) { result = resourceReference ; } } catch ( ComponentLookupException e ) { // Failed to lookup component, this shouldn't happen but ignore it. } } else { // Check if it's a URL ResourceReference resourceReference = this . urlResourceReferenceTypeParser . parse ( rawLink ) ; if ( resourceReference != null ) { resourceReference . setTyped ( false ) ; result = resourceReference ; } } } return result ; }
Check if the passed link references is an URI link reference .