| | |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012-2014 ForgeRock AS |
| | | * Portions Copyright 2012-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui; |
| | |
| | | { |
| | | String dn = this.dn.getText(); |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.append("dn: "+dn); |
| | | sb.append("dn: ").append(dn); |
| | | for (String attrName : entryToDuplicate.getAttributeNames()) |
| | | { |
| | | List<Object> values = entryToDuplicate.getAttributeValues(attrName); |
| | |
| | | String pwd = new String(password.getPassword()); |
| | | if (!pwd.isEmpty()) |
| | | { |
| | | sb.append(attrName+": " + pwd); |
| | | sb.append(attrName).append(": ").append(pwd); |
| | | } |
| | | } |
| | | else if (!attrName.equalsIgnoreCase(rdnAttribute)) |
| | |
| | | for (Object value : values) |
| | | { |
| | | sb.append("\n"); |
| | | if (value instanceof String) |
| | | if (value instanceof byte[]) |
| | | { |
| | | sb.append(attrName+": "+value); |
| | | } |
| | | else if (value instanceof byte[]) |
| | | { |
| | | sb.append(attrName+":: "+Base64.encode((byte[])value)); |
| | | final String base64 = Base64.encode((byte[]) value); |
| | | sb.append(attrName).append(":: ").append(base64); |
| | | } |
| | | else |
| | | { |
| | | sb.append(attrName+": "+value); |
| | | sb.append(attrName).append(": ").append(value); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (values.size() == 1) |
| | | { |
| | | sb.append("\n"); |
| | | sb.append(attrName+": "+newValue); |
| | | sb.append(attrName).append(": ").append(newValue); |
| | | } |
| | | else |
| | | { |
| | |
| | | sb.append("\n"); |
| | | if (oldValue.equals(value)) |
| | | { |
| | | sb.append(attrName+": "+newValue); |
| | | sb.append(attrName).append(": ").append(newValue); |
| | | } |
| | | else |
| | | { |
| | | sb.append(attrName+": "+value); |
| | | sb.append(attrName).append(": ").append(value); |
| | | } |
| | | } |
| | | } |