public static String getResourcePathFor ( CharSequence name , Class < ? > cls ) { int nameLen ; StringBuilder sb ; if ( name == null ) throw new NullPointerException ( "name is null" ) ; if ( cls == null ) throw new NullPointerException ( "cls is null" ) ; nameLen = name . length ( ) ; sb = new StringBuilder ( cls . getName ( ) . length ( ) + nameLen + 2 ) ; appendResourcePathPrefixFor ( sb , cls ) ; cls = null ; if ( name . charAt ( 0 ) != ' ' ) sb . append ( name , 1 , nameLen ) ; else sb . append ( name ) ; name = null ; return sb . toString ( ) ; }
Gets a resource path using cls s package name as the prefix .