Package org.apache.directory.studio.ldifparser

Examples of org.apache.directory.studio.ldifparser.LdifFormatParameters


        BufferedWriter bufferedWriter, int count, StudioProgressMonitor monitor ) throws IOException
    {
        try
        {
            JndiLdifEnumeration enumeration = search( browserConnection, searchParameter, monitor );
            LdifFormatParameters ldifFormatParameters = Utils.getLdifFormatParameters();

            // add version spec
            LdifVersionLine ldifVersionLine = LdifVersionLine.create();
            String ldifVersionLineString = ldifVersionLine.toFormattedString( ldifFormatParameters );
            bufferedWriter.write( ldifVersionLineString );
View Full Code Here


    private static void logModificationError( IBrowserConnection browserConnection, Writer logWriter,
        LdifRecord record, Throwable exception, StudioProgressMonitor monitor )
    {
        try
        {
            LdifFormatParameters ldifFormatParameters = Utils.getLdifFormatParameters();
            DateFormat df = new SimpleDateFormat( ConnectionCoreConstants.DATEFORMAT );

            String errorComment = "#!ERROR " + exception.getMessage(); //$NON-NLS-1$
            errorComment = errorComment.replaceAll( "\r", " " ); //$NON-NLS-1$ //$NON-NLS-2$
            errorComment = errorComment.replaceAll( "\n", " " ); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

    private static void logModification( IBrowserConnection browserConnection, Writer logWriter, LdifRecord record,
        StudioProgressMonitor monitor )
    {
        try
        {
            LdifFormatParameters ldifFormatParameters = Utils.getLdifFormatParameters();
            DateFormat df = new SimpleDateFormat( ConnectionCoreConstants.DATEFORMAT );
            logWriter.write( LdifCommentLine.create( "#!RESULT OK" ).toFormattedString( ldifFormatParameters ) ); //$NON-NLS-1$
            logWriter
                .write( LdifCommentLine
                    .create(
View Full Code Here

{

    public void testToFormattedStringSimple()
    {
        LdifDnLine dnLine = LdifDnLine.create( "cn=abc,ou=department,o=org,dc=example,dc=com" );
        LdifFormatParameters formatParameters = new LdifFormatParameters( true, 78, "\n" );
        String formattedString = dnLine.toFormattedString( formatParameters );
        assertEquals( formattedString, "dn: cn=abc,ou=department,o=org,dc=example,dc=com\n" );
    }
View Full Code Here


    public void testToFormattedStringNewline()
    {
        LdifDnLine dnLine = LdifDnLine.create( "cn=abc,ou=department,o=org,dc=example,dc=com" );
        LdifFormatParameters formatParameters = new LdifFormatParameters( true, 78, "\r\n" );
        String formattedString = dnLine.toFormattedString( formatParameters );
        assertEquals( formattedString, "dn: cn=abc,ou=department,o=org,dc=example,dc=com\r\n" );
    }
View Full Code Here

    public void testToFormattedStringLineWrap()
    {
        LdifDnLine dnLine = LdifDnLine
            .create( "cn=abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxy,ou=department,o=org,dc=example,dc=com" );
        LdifFormatParameters formatParameters = new LdifFormatParameters( true, 78, "\n" );
        String formattedString = dnLine.toFormattedString( formatParameters );
        assertEquals( formattedString, "dn: cn=abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxy,ou=department,o=org"
            + "\n ,dc=example,dc=com\n" );
    }
View Full Code Here


    public void testToFormattedStringNoSpaceAfterColon()
    {
        LdifDnLine dnLine = LdifDnLine.create( "cn=abc,ou=department,o=org,dc=example,dc=com" );
        LdifFormatParameters formatParameters = new LdifFormatParameters( false, 78, "\n" );
        String formattedString = dnLine.toFormattedString( formatParameters );
        assertEquals( formattedString, "dn:cn=abc,ou=department,o=org,dc=example,dc=com\n" );
    }
View Full Code Here


    public void testToFormattedStringBase64()
    {
        LdifDnLine dnLine = LdifDnLine.create( "cn=\u00e4\u00f6\u00fc,ou=department,o=org,dc=example,dc=com" );
        LdifFormatParameters formatParameters = new LdifFormatParameters( true, 78, "\n" );
        String formattedString = dnLine.toFormattedString( formatParameters );
        assertEquals( formattedString, "dn:: Y249w6TDtsO8LG91PWRlcGFydG1lbnQsbz1vcmcsZGM9ZXhhbXBsZSxkYz1jb20=\n" );
    }
View Full Code Here

    {
        Preferences store = BrowserCorePlugin.getDefault().getPluginPreferences();
        boolean spaceAfterColon = store.getBoolean( BrowserCoreConstants.PREFERENCE_LDIF_SPACE_AFTER_COLON );
        int lineWidth = store.getInt( BrowserCoreConstants.PREFERENCE_LDIF_LINE_WIDTH );
        String lineSeparator = store.getString( BrowserCoreConstants.PREFERENCE_LDIF_LINE_SEPARATOR );
        LdifFormatParameters ldifFormatParameters = new LdifFormatParameters( spaceAfterColon, lineWidth, lineSeparator );
        return ldifFormatParameters;
    }
View Full Code Here

    {
        Preferences store = BrowserCorePlugin.getDefault().getPluginPreferences();
        boolean spaceAfterColon = store.getBoolean( BrowserCoreConstants.PREFERENCE_LDIF_SPACE_AFTER_COLON );
        int lineWidth = store.getInt( BrowserCoreConstants.PREFERENCE_LDIF_LINE_WIDTH );
        String lineSeparator = store.getString( BrowserCoreConstants.PREFERENCE_LDIF_LINE_SEPARATOR );
        LdifFormatParameters ldifFormatParameters = new LdifFormatParameters( spaceAfterColon, lineWidth, lineSeparator );
        return ldifFormatParameters;
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.ldifparser.LdifFormatParameters

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.