Example usage for org.eclipse.jgit.util StringUtils toLowerCase

List of usage examples for org.eclipse.jgit.util StringUtils toLowerCase

Introduction

In this page you can find the example usage for org.eclipse.jgit.util StringUtils toLowerCase.

Prototype

public static String toLowerCase(String in) 

Source Link

Document

Convert the input string to lower case, according to the "C" locale.

Usage

From source file:com.google.gerrit.server.git.ProjectConfig.java

License:Apache License

private void saveNotifySections(Config rc, Set<AccountGroup.UUID> keepGroups) {
    for (NotifyConfig nc : sort(notifySections.values())) {
        List<String> email = Lists.newArrayList();
        for (GroupReference gr : nc.getGroups()) {
            if (gr.getUUID() != null) {
                keepGroups.add(gr.getUUID());
            }/*from ww  w  .  jav  a 2s  .c  om*/
            email.add(new PermissionRule(gr).asString(false));
        }
        Collections.sort(email);

        List<String> addrs = Lists.newArrayList();
        for (Address addr : nc.getAddresses()) {
            addrs.add(addr.toString());
        }
        Collections.sort(addrs);
        email.addAll(addrs);

        set(rc, NOTIFY, nc.getName(), KEY_HEADER, nc.getHeader(), NotifyConfig.Header.BCC);
        if (email.isEmpty()) {
            rc.unset(NOTIFY, nc.getName(), KEY_EMAIL);
        } else {
            rc.setStringList(NOTIFY, nc.getName(), KEY_EMAIL, email);
        }

        if (nc.getNotify().equals(EnumSet.of(NotifyType.ALL))) {
            rc.unset(NOTIFY, nc.getName(), KEY_TYPE);
        } else {
            List<String> types = Lists.newArrayListWithCapacity(4);
            for (NotifyType t : NotifyType.values()) {
                if (nc.isNotify(t)) {
                    types.add(StringUtils.toLowerCase(t.name()));
                }
            }
            rc.setStringList(NOTIFY, nc.getName(), KEY_TYPE, types);
        }

        set(rc, NOTIFY, nc.getName(), KEY_FILTER, nc.getFilter());
    }
}