private void setAuthorizations(String... authorizations) { auths.clear(); for (String str : authorizations) { str = str.trim(); auths.add(new ArrayByteSequence(str.getBytes(Constants.UTF8))); } checkAuths(); }
private void setAuthorizations(String... authorizations) { auths.clear(); for (String str : authorizations) { str = str.trim(); auths.add(new ArrayByteSequence(str.getBytes(Constants.UTF8))); } checkAuths(); }
/** * Constructs an authorization object from a collection of string authorizations that have each already been encoded as UTF-8 bytes. Warning: This method does * not verify that each encoded string is valid UTF-8. * * @param authorizations collection of authorizations, as strings encoded in UTF-8 * @throws IllegalArgumentException if authorizations is null * @see #Authorizations(String...) */ public Authorizations(Collection<byte[]> authorizations) { for (byte[] auth : authorizations) auths.add(new ArrayByteSequence(auth)); checkAuths(); }
/** * Constructs an authorization object from a collection of string authorizations that have each already been encoded as UTF-8 bytes. Warning: This method does * not verify that each encoded string is valid UTF-8. * * @param authorizations collection of authorizations, as strings encoded in UTF-8 * @throws IllegalArgumentException if authorizations is null * @see #Authorizations(String...) */ public Authorizations(Collection<byte[]> authorizations) { for (byte[] auth : authorizations) auths.add(new ArrayByteSequence(auth)); checkAuths(); }
/** * Constructs an authorization object from a list of string authorizations that have each already been encoded as UTF-8 bytes. Warning: This method does not * verify that each encoded string is valid UTF-8. * * @param authorizations list of authorizations, as strings encoded in UTF-8 and placed in buffers * @throws IllegalArgumentException if authorizations is null * @see #Authorizations(String...) */ public Authorizations(List<ByteBuffer> authorizations) { for (ByteBuffer buffer : authorizations) { auths.add(new ArrayByteSequence(ByteBufferUtil.toBytes(buffer))); } checkAuths(); }
/** * Constructs an authorization object from a list of string authorizations that have each already been encoded as UTF-8 bytes. Warning: This method does not * verify that each encoded string is valid UTF-8. * * @param authorizations list of authorizations, as strings encoded in UTF-8 and placed in buffers * @throws IllegalArgumentException if authorizations is null * @see #Authorizations(String...) */ public Authorizations(List<ByteBuffer> authorizations) { for (ByteBuffer buffer : authorizations) { auths.add(new ArrayByteSequence(ByteBufferUtil.toBytes(buffer))); } checkAuths(); }