Java Code Examples for org.apache.commons.lang.ArrayUtils#EMPTY_CHAR_ARRAY

The following examples show how to use org.apache.commons.lang.ArrayUtils#EMPTY_CHAR_ARRAY . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Arja_00151_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Copies part of the builder's character array into a new character array.
 * 
 * @param startIndex  the start index, inclusive, must be valid
 * @param endIndex  the end index, exclusive, must be valid except that
 *  if too large it is treated as end of string
 * @return a new array that holds part of the contents of the builder
 * @throws IndexOutOfBoundsException if startIndex is invalid,
 *  or if endIndex is invalid (but endIndex greater than size is valid)
 */
public char[] toCharArray(int startIndex, int endIndex) {
    endIndex = validateRange(startIndex, endIndex);
    int len = endIndex - startIndex;
    if (len == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[len];
    System.arraycopy(buffer, startIndex, chars, 0, len);
    return chars;
}
 
Example 2
Source File: 1_StrBuilder.java    From SimFix with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Copies part of the builder's character array into a new character array.
 * 
 * @param startIndex  the start index, inclusive, must be valid
 * @param endIndex  the end index, exclusive, must be valid except that
 *  if too large it is treated as end of string
 * @return a new array that holds part of the contents of the builder
 * @throws IndexOutOfBoundsException if startIndex is invalid,
 *  or if endIndex is invalid (but endIndex greater than size is valid)
 */
public char[] toCharArray(int startIndex, int endIndex) {
    endIndex = validateRange(startIndex, endIndex);
    int len = endIndex - startIndex;
    if (len == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[len];
    System.arraycopy(buffer, startIndex, chars, 0, len);
    return chars;
}
 
Example 3
Source File: KeyStoreCredential.java    From freehealth-connector with GNU Affero General Public License v3.0 5 votes vote down vote up
public KeyStoreCredential(UUID keystoreId, KeyStore keyStore, String alias, String password, String quality) throws TechnicalConnectorException {
   super(quality);

   this.keystoreId = keystoreId;
   this.password = password == null ? ArrayUtils.EMPTY_CHAR_ARRAY : password.toCharArray();
   this.alias = alias;
   this.keyStore = keyStore;
}
 
Example 4
Source File: Arja_0099_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Copies the builder's character array into a new character array.
 * 
 * @return a new array that represents the contents of the builder
 */
public char[] toCharArray() {
    if (size == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[size];
    System.arraycopy(buffer, 0, chars, 0, size);
    return chars;
}
 
Example 5
Source File: 1_StrBuilder.java    From SimFix with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Copies the builder's character array into a new character array.
 * 
 * @return a new array that represents the contents of the builder
 */
public char[] toCharArray() {
    if (size == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[size];
    System.arraycopy(buffer, 0, chars, 0, size);
    return chars;
}
 
Example 6
Source File: SessionManagerImpl.java    From freehealth-connector with GNU Affero General Public License v3.0 5 votes vote down vote up
private void loadHolderOfKeyKeys(String pwd, boolean eidonly) throws TechnicalConnectorException {
   LOG.debug("Loading HolderOfKeyKeys");
   char[] password = pwd == null ? ArrayUtils.EMPTY_CHAR_ARRAY : pwd.toCharArray();
   if (this.cache.containsKey("holderofkey")) {
      KeyStore hokstore = (KeyStore)this.cache.get("holderofkey");
      this.session.setHolderOfKeyCredential(new KeyStoreCredential(hokstore, this.config.getProperty("sessionmanager.holderofkey.alias", "authentication"), pwd));
      this.session.setHolderOfKeyPrivateKeys(KeyManager.getDecryptionKeys(hokstore, password));
   } else if (pwd == null && eidonly) {
      Credential authCredential = BeIDCredential.getInstance("session", "Authentication");
      Map<String, PrivateKey> authPK = new HashMap();
      authPK.put("authentication", authCredential.getPrivateKey());
      this.session.setHolderOfKeyCredential(authCredential);
      this.session.setHolderOfKeyPrivateKeys(authPK);
   } else {
      if (pwd == null && !this.config.getBooleanProperty("sessionmanager.holderofkey.emptypassword", false).booleanValue()) {
         return;
      }

      try {
         String pathKeystore = this.config.getProperty("sessionmanager.holderofkey.keystore");
         String privateKeyAlias = this.config.getProperty("sessionmanager.holderofkey.alias", "authentication");
         KeyStoreInfo ksInfo = new KeyStoreInfo(pathKeystore, password, privateKeyAlias, password);
         KeyStoreManager encryptionKeystoreManager = new KeyStoreManager(ksInfo);
         Map<String, PrivateKey> hokPrivateKeys = KeyManager.getDecryptionKeys(encryptionKeystoreManager.getKeyStore(), ksInfo.getPrivateKeyPassword());
         this.session.setHolderOfKeyCredential(new KeyStoreCredential(ksInfo));
         this.session.setHolderOfKeyPrivateKeys(hokPrivateKeys);
         fetchEtk(KeyDepotManager.EncryptionTokenType.HOLDER_OF_KEY, hokPrivateKeys, this.config);
      } catch (Exception var11) {
         throw translate(var11, "HolderOfKey");
      }
   }

}
 
Example 7
Source File: 1_StrBuilder.java    From SimFix with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Copies the builder's character array into a new character array.
 * 
 * @return a new array that represents the contents of the builder
 */
public char[] toCharArray() {
    if (size == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[size];
    System.arraycopy(buffer, 0, chars, 0, size);
    return chars;
}
 
Example 8
Source File: Elixir_0017_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Copies the builder's character array into a new character array.
 * 
 * @return a new array that represents the contents of the builder
 */
public char[] toCharArray() {
    if (size == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[size];
    System.arraycopy(buffer, 0, chars, 0, size);
    return chars;
}
 
Example 9
Source File: Arja_00120_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Copies part of the builder's character array into a new character array.
 * 
 * @param startIndex  the start index, inclusive, must be valid
 * @param endIndex  the end index, exclusive, must be valid except that
 *  if too large it is treated as end of string
 * @return a new array that holds part of the contents of the builder
 * @throws IndexOutOfBoundsException if startIndex is invalid,
 *  or if endIndex is invalid (but endIndex greater than size is valid)
 */
public char[] toCharArray(int startIndex, int endIndex) {
    endIndex = validateRange(startIndex, endIndex);
    int len = endIndex - startIndex;
    if (len == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[len];
    System.arraycopy(buffer, startIndex, chars, 0, len);
    return chars;
}
 
Example 10
Source File: Arja_0074_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Copies the builder's character array into a new character array.
 * 
 * @return a new array that represents the contents of the builder
 */
public char[] toCharArray() {
    if (size == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[size];
    System.arraycopy(buffer, 0, chars, 0, size);
    return chars;
}
 
Example 11
Source File: Arja_0023_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Copies part of the builder's character array into a new character array.
 * 
 * @param startIndex  the start index, inclusive, must be valid
 * @param endIndex  the end index, exclusive, must be valid except that
 *  if too large it is treated as end of string
 * @return a new array that holds part of the contents of the builder
 * @throws IndexOutOfBoundsException if startIndex is invalid,
 *  or if endIndex is invalid (but endIndex greater than size is valid)
 */
public char[] toCharArray(int startIndex, int endIndex) {
    endIndex = validateRange(startIndex, endIndex);
    int len = endIndex - startIndex;
    if (len == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[len];
    System.arraycopy(buffer, startIndex, chars, 0, len);
    return chars;
}
 
Example 12
Source File: StrBuilder.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Copies part of the builder's character array into a new character array.
 * 
 * @param startIndex  the start index, inclusive, must be valid
 * @param endIndex  the end index, exclusive, must be valid except that
 *  if too large it is treated as end of string
 * @return a new array that holds part of the contents of the builder
 * @throws IndexOutOfBoundsException if startIndex is invalid,
 *  or if endIndex is invalid (but endIndex greater than size is valid)
 */
public char[] toCharArray(int startIndex, int endIndex) {
    endIndex = validateRange(startIndex, endIndex);
    int len = endIndex - startIndex;
    if (len == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[len];
    System.arraycopy(buffer, startIndex, chars, 0, len);
    return chars;
}
 
Example 13
Source File: StrBuilder.java    From SimFix with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Copies part of the builder's character array into a new character array.
 * 
 * @param startIndex  the start index, inclusive, must be valid
 * @param endIndex  the end index, exclusive, must be valid except that
 *  if too large it is treated as end of string
 * @return a new array that holds part of the contents of the builder
 * @throws IndexOutOfBoundsException if startIndex is invalid,
 *  or if endIndex is invalid (but endIndex greater than size is valid)
 */
public char[] toCharArray(int startIndex, int endIndex) {
    endIndex = validateRange(startIndex, endIndex);
    int len = endIndex - startIndex;
    if (len == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[len];
    System.arraycopy(buffer, startIndex, chars, 0, len);
    return chars;
}
 
Example 14
Source File: Arja_0099_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Copies the builder's character array into a new character array.
 * 
 * @return a new array that represents the contents of the builder
 */
public char[] toCharArray() {
    if (size == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[size];
    System.arraycopy(buffer, 0, chars, 0, size);
    return chars;
}
 
Example 15
Source File: Arja_00136_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Copies the builder's character array into a new character array.
 * 
 * @return a new array that represents the contents of the builder
 */
public char[] toCharArray() {
    if (size == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[size];
    System.arraycopy(buffer, 0, chars, 0, size);
    return chars;
}
 
Example 16
Source File: Arja_00175_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Copies part of the builder's character array into a new character array.
 * 
 * @param startIndex  the start index, inclusive, must be valid
 * @param endIndex  the end index, exclusive, must be valid except that
 *  if too large it is treated as end of string
 * @return a new array that holds part of the contents of the builder
 * @throws IndexOutOfBoundsException if startIndex is invalid,
 *  or if endIndex is invalid (but endIndex greater than size is valid)
 */
public char[] toCharArray(int startIndex, int endIndex) {
    endIndex = validateRange(startIndex, endIndex);
    int len = endIndex - startIndex;
    if (len == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[len];
    System.arraycopy(buffer, startIndex, chars, 0, len);
    return chars;
}
 
Example 17
Source File: Arja_0075_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Copies the builder's character array into a new character array.
 * 
 * @return a new array that represents the contents of the builder
 */
public char[] toCharArray() {
    if (size == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[size];
    System.arraycopy(buffer, 0, chars, 0, size);
    return chars;
}
 
Example 18
Source File: Lang_59_StrBuilder_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Copies part of the builder's character array into a new character array.
 * 
 * @param startIndex  the start index, inclusive, must be valid
 * @param endIndex  the end index, exclusive, must be valid except that
 *  if too large it is treated as end of string
 * @return a new array that holds part of the contents of the builder
 * @throws IndexOutOfBoundsException if startIndex is invalid,
 *  or if endIndex is invalid (but endIndex greater than size is valid)
 */
public char[] toCharArray(int startIndex, int endIndex) {
    endIndex = validateRange(startIndex, endIndex);
    int len = endIndex - startIndex;
    if (len == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[len];
    System.arraycopy(buffer, startIndex, chars, 0, len);
    return chars;
}
 
Example 19
Source File: Arja_00151_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Copies part of the builder's character array into a new character array.
 * 
 * @param startIndex  the start index, inclusive, must be valid
 * @param endIndex  the end index, exclusive, must be valid except that
 *  if too large it is treated as end of string
 * @return a new array that holds part of the contents of the builder
 * @throws IndexOutOfBoundsException if startIndex is invalid,
 *  or if endIndex is invalid (but endIndex greater than size is valid)
 */
public char[] toCharArray(int startIndex, int endIndex) {
    endIndex = validateRange(startIndex, endIndex);
    int len = endIndex - startIndex;
    if (len == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[len];
    System.arraycopy(buffer, startIndex, chars, 0, len);
    return chars;
}
 
Example 20
Source File: Arja_0022_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Copies the builder's character array into a new character array.
 * 
 * @return a new array that represents the contents of the builder
 */
public char[] toCharArray() {
    if (size == 0) {
        return ArrayUtils.EMPTY_CHAR_ARRAY;
    }
    char chars[] = new char[size];
    System.arraycopy(buffer, 0, chars, 0, size);
    return chars;
}