@Test public void testIsLdifSafeStartingWithColon() { char c = ( char ) 58; assertFalse( LdifUtils.isLDIFSafe( c + testString ) ); }
public static boolean isLDIFSafe( String str ) { if ( Strings.isEmpty( str ) ) { return true; } char currentChar = str.charAt( 0 ); if ( ( currentChar > 127 ) || !LDIF_SAFE_STARTING_CHAR_ALPHABET[currentChar] ) { return false; } for ( int i = 1; i < str.length(); i++ ) { currentChar = str.charAt( i ); if ( ( currentChar > 127 ) || !LDIF_SAFE_OTHER_CHARS_ALPHABET[currentChar] ) { return false; } } return currentChar != ' '; }
LdifUtils { public static boolean isLDIFSafe( String str ) { if ( Strings.isEmpty( str ) ) { return true; } char currentChar = str.charAt( 0 ); if ( ( currentChar > 127 ) || !LDIF_SAFE_STARTING_CHAR_ALPHABET[currentChar] ) { return false; } for ( int i = 1; i < str.length(); i++ ) { currentChar = str.charAt( i ); if ( ( currentChar > 127 ) || !LDIF_SAFE_OTHER_CHARS_ALPHABET[currentChar] ) { return false; } } return currentChar != ' '; } }
LdifUtils { public static boolean isLDIFSafe( String str ) { if ( Strings.isEmpty( str ) ) { return true; } char currentChar = str.charAt( 0 ); if ( ( currentChar > 127 ) || !LDIF_SAFE_STARTING_CHAR_ALPHABET[currentChar] ) { return false; } for ( int i = 1; i < str.length(); i++ ) { currentChar = str.charAt( i ); if ( ( currentChar > 127 ) || !LDIF_SAFE_OTHER_CHARS_ALPHABET[currentChar] ) { return false; } } return currentChar != ' '; } private  LdifUtils(); }
LdifUtils { public static boolean isLDIFSafe( String str ) { if ( Strings.isEmpty( str ) ) { return true; } char currentChar = str.charAt( 0 ); if ( ( currentChar > 127 ) || !LDIF_SAFE_STARTING_CHAR_ALPHABET[currentChar] ) { return false; } for ( int i = 1; i < str.length(); i++ ) { currentChar = str.charAt( i ); if ( ( currentChar > 127 ) || !LDIF_SAFE_OTHER_CHARS_ALPHABET[currentChar] ) { return false; } } return currentChar != ' '; } private  LdifUtils(); static boolean isLDIFSafe( String str ); static String convertToLdif( Attributes attrs ); static String convertToLdif( Attributes attrs, int length ); static String convertToLdif( Attributes attrs, Dn dn, int length ); static String convertToLdif( Attributes attrs, Dn dn ); static String convertToLdif( Entry entry ); static String convertToLdif( Entry entry, boolean includeVersionInfo ); static String convertAttributesToLdif( Entry entry ); static Attributes getJndiAttributesFromLdif( String ldif ); static String convertToLdif( Entry entry, int length ); static String convertAttributesToLdif( Entry entry, int length ); static String convertToLdif( LdifEntry entry ); static String convertToLdif( LdifEntry entry, int length ); static String convertToLdif( Attribute attr ); static String convertToLdif( Attribute attr, int length ); static String stripLineToNChars( String str, int nbChars ); static Attributes createJndiAttributes( Object... avas ); }
LdifUtils { public static boolean isLDIFSafe( String str ) { if ( Strings.isEmpty( str ) ) { return true; } char currentChar = str.charAt( 0 ); if ( ( currentChar > 127 ) || !LDIF_SAFE_STARTING_CHAR_ALPHABET[currentChar] ) { return false; } for ( int i = 1; i < str.length(); i++ ) { currentChar = str.charAt( i ); if ( ( currentChar > 127 ) || !LDIF_SAFE_OTHER_CHARS_ALPHABET[currentChar] ) { return false; } } return currentChar != ' '; } private  LdifUtils(); static boolean isLDIFSafe( String str ); static String convertToLdif( Attributes attrs ); static String convertToLdif( Attributes attrs, int length ); static String convertToLdif( Attributes attrs, Dn dn, int length ); static String convertToLdif( Attributes attrs, Dn dn ); static String convertToLdif( Entry entry ); static String convertToLdif( Entry entry, boolean includeVersionInfo ); static String convertAttributesToLdif( Entry entry ); static Attributes getJndiAttributesFromLdif( String ldif ); static String convertToLdif( Entry entry, int length ); static String convertAttributesToLdif( Entry entry, int length ); static String convertToLdif( LdifEntry entry ); static String convertToLdif( LdifEntry entry, int length ); static String convertToLdif( Attribute attr ); static String convertToLdif( Attribute attr, int length ); static String stripLineToNChars( String str, int nbChars ); static Attributes createJndiAttributes( Object... avas );  }