| | |
| | | */ |
| | | public static boolean needsBase64Encoding(byte[] valueBytes) |
| | | { |
| | | |
| | | int length; |
| | | if ((valueBytes == null) || ((length = valueBytes.length) == 0)) |
| | | { |
| | |
| | | */ |
| | | public static boolean needsBase64Encoding(String valueString) |
| | | { |
| | | |
| | | int length; |
| | | if ((valueString == null) || ((length = valueString.length()) == 0)) |
| | | { |
| | |
| | | */ |
| | | public static boolean mayUseExec() |
| | | { |
| | | |
| | | String s = System.getProperty(PROPERTY_DISABLE_EXEC); |
| | | if (s == null) |
| | | { |
| | |
| | | Map<String,String> environment, List<String> output) |
| | | throws IOException, SecurityException |
| | | { |
| | | |
| | | |
| | | // See whether we'll allow the use of exec on this system. If not, then |
| | | // throw an exception. |
| | | if (! mayUseExec()) |
| | |
| | | int endPos, |
| | | StringBuilder invalidReason) |
| | | { |
| | | |
| | | |
| | | if ((element == null) || (startPos >= endPos)) |
| | | { |
| | | int msgID = MSGID_SCHEMANAME_EMPTY_VALUE; |
| | |
| | | */ |
| | | public static String toLowerCase(String s) |
| | | { |
| | | |
| | | if (s == null) |
| | | { |
| | | return null; |
| | |
| | | */ |
| | | public static void toLowerCase(String s, StringBuilder buffer) |
| | | { |
| | | |
| | | if (s == null) |
| | | { |
| | | return; |
| | |
| | | */ |
| | | public static void toLowerCase(byte[] b, StringBuilder buffer, boolean trim) |
| | | { |
| | | |
| | | if (b == null) |
| | | { |
| | | return; |
| | |
| | | */ |
| | | public static String toUpperCase(String s) |
| | | { |
| | | |
| | | if (s == null) |
| | | { |
| | | return null; |
| | |
| | | */ |
| | | public static void toUpperCase(String s, StringBuilder buffer) |
| | | { |
| | | |
| | | if (s == null) |
| | | { |
| | | return; |
| | |
| | | */ |
| | | public static void toUpperCase(byte[] b, StringBuilder buffer, boolean trim) |
| | | { |
| | | |
| | | if (b == null) |
| | | { |
| | | return; |
| | |
| | | public static StringBuilder toRFC3641StringValue(StringBuilder builder, |
| | | String string) |
| | | { |
| | | |
| | | // Initial double-quote. |
| | | builder.append('"'); |
| | | |
| | |
| | | */ |
| | | public static String[] listToArray(List<String> stringList) |
| | | { |
| | | |
| | | if (stringList == null) |
| | | { |
| | | return null; |
| | |
| | | */ |
| | | public static ArrayList<String> arrayToList(String[] stringArray) |
| | | { |
| | | |
| | | if (stringArray == null) |
| | | { |
| | | return null; |
| | |
| | | */ |
| | | public static boolean recursiveDelete(File file) |
| | | { |
| | | |
| | | boolean successful = true; |
| | | if (file.isDirectory()) |
| | | { |
| | |
| | | */ |
| | | public static boolean isRelativePath(String path) |
| | | { |
| | | |
| | | File f = new File(path); |
| | | return (! f.isAbsolute()); |
| | | } |
| | |
| | | */ |
| | | public static File getFileForPath(String path) |
| | | { |
| | | |
| | | File f = new File (path); |
| | | |
| | | if (f.isAbsolute()) |
| | |
| | | */ |
| | | public static Entry createEntry(DN dn) |
| | | { |
| | | |
| | | |
| | | // If the provided DN was null or empty, then return null because we don't |
| | | // support it. |
| | | if ((dn == null) || dn.isNullDN()) |