| | |
| | | import java.io.IOException; |
| | | import java.io.PrintStream; |
| | | |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.protocols.ldap.LDAPControl; |
| | | import org.opends.server.protocols.ldap.LDAPResultCode; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.ByteString; |
| | | |
| | | import static org.opends.messages.ToolMessages.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | |
| | | LDAPControl control = null; |
| | | String controlOID = null; |
| | | boolean controlCriticality = false; |
| | | ASN1OctetString controlValue = null; |
| | | ByteString controlValue = null; |
| | | |
| | | int idx = argString.indexOf(":"); |
| | | |
| | |
| | | if(valString.charAt(0) == ':') |
| | | { |
| | | controlValue = |
| | | new ASN1OctetString(valString.substring(1, valString.length())); |
| | | ByteString.valueOf(valString.substring(1, valString.length())); |
| | | } else if(valString.charAt(0) == '<') |
| | | { |
| | | // Read data from the file. |
| | |
| | | try |
| | | { |
| | | byte[] val = readBytesFromFile(filePath, err); |
| | | controlValue = new ASN1OctetString(val); |
| | | controlValue = ByteString.wrap(val); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | } |
| | | } else |
| | | { |
| | | controlValue = new ASN1OctetString(valString); |
| | | controlValue = ByteString.valueOf(valString); |
| | | } |
| | | |
| | | control = new LDAPControl(controlOID, controlCriticality, controlValue); |