//
// reverse order of dot-separated name components up
// till the first slash.
//
int firstSlash = s.indexOf('/');
if (firstSlash > 0) {
ByteString prefix = s.substring(0, firstSlash);
ByteString[] elems = prefix.split('.');
for (int i = elems.length - 1; i >= 0; i--) {