requireResourceNonNull

fun <T> requireResourceNonNull(resource: T?, name: String?): T?

Wrap all calls to Class.getResource or Class.getResourceAsStream using this method to enforce existence of the resource. This code works around those methods returning null to signal non-existence.

Return

the resource passed in if existent

Parameters

resource

return value of above methods

name

of resource

Throws

FileNotFoundException

if resource was not found