// non-rooted
referenceRoot = "";
isRelative = true;
}
// Get the mailbox for the reference name.
MailboxPath rootPath = new MailboxPath(referenceRoot, "", "");
results = new ArrayList<MailboxMetaData>(1);
results.add(SimpleMailboxMetaData.createNoSelect(rootPath, mailboxSession.getPathDelimiter()));
} else {
// If the mailboxPattern is fully qualified, ignore the
// reference name.
String finalReferencename = referenceName;
if (mailboxName.charAt(0) == MailboxConstants.NAMESPACE_PREFIX_CHAR) {
finalReferencename = "";
}
// Is the interpreted (combined) pattern relative?
isRelative = ((finalReferencename + mailboxName).charAt(0) != MailboxConstants.NAMESPACE_PREFIX_CHAR);
MailboxPath basePath = null;
if (isRelative) {
basePath = new MailboxPath(MailboxConstants.USER_NAMESPACE, user, finalReferencename);
} else {
basePath = buildFullPath(session, finalReferencename);
}
results = getMailboxManager().search(new MailboxQuery(basePath, mailboxName, mailboxSession.getPathDelimiter()), mailboxSession);