I undertstand "resource-type" to be a concept that is essentially represented by the relative path (i.e. without search path prefixes). The fact that we allow absolute paths as resource type is probably mostly historical (there may be some edge use-cases like enforcing the use of an otherwise overlayed RT, but I would not feel too bad if we break this).
So I agree with you that isResourceType() should work based on the concept rather than the implementation detail (i.e. String). Like Bertrand, I think it should be symetric. So +1 from my side. Regards Julian On Thu, Nov 24, 2016 at 3:00 PM, Bertrand Delacretaz <[email protected]> wrote: > On Thu, Nov 24, 2016 at 2:29 PM, Konrad Windszus <[email protected]> wrote: >> ...no change for absolute resource paths given as parameter but only for >> relative resource paths... > > I think this should be symmetric: no change if comparing two absolute > resource types, but if at least one of them is relative make both > relative based on the search path. > > Something like > > public boolean Resource.isResourceType(String type) { > if(this.getResourceType().startsWith(SLASH) && type.startsWith(SLASH)) { > return type.equals(this.getResourceType()); > } else { > return relativeType(this.getResourceType()).equals(relativeType(type)); > } > > Where relativeType(...) is your for loop above, testing for absolute > path before transforming. > > -Bertrand
