[ 
https://issues.apache.org/jira/browse/DIRSTUDIO-356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625515#action_12625515
 ] 

Stefan Seelmann commented on DIRSTUDIO-356:
-------------------------------------------

Added a first implementation here:
  http://svn.apache.org/viewvc?rev=688867&view=rev

I have the following problem, not sure if this must be handled in my code or if 
there are encoding issues in the LdapURL class or if an LDAP URL doesn't 
support non-ASCII characters. When my connection name has non-ASCII characters 
(e.g. Ä alias %C4 (ULR encoded) alias C384 (UTF-8 encoded))  then the extension 
part of the resulting URL string contains these non-ASCII characters. When 
parsing this string back to an LdapURL it just contains an '?'. Has anyone an 
hint how to handle it?

Here is some test code:

    public void testNonAscii() throws Exception
    {
        String A_uml = new String( new byte[] { (byte)0xC3, (byte)0x84 }, 
"UTF-8" );
        
        LdapURL url1 = new LdapURL();
        url1.setHost( "localhost" );
        url1.setPort( 389 );
        url1.setDn( LdapDN.EMPTY_LDAPDN );
        url1.getExtensions().put( "X-CONNECTION-NAME", A_uml );
        System.out.println(url1.toString());
        System.out.println(url1.getExtensions());
        
        LdapURL url2 = new 
LdapURL("ldap://localhost:389/????X-CONNECTION-NAME="; + A_uml);
        System.out.println(url2.toString());
        System.out.println(url2.getExtensions());
        
        LdapURL url3 = new 
LdapURL("ldap://localhost:389/????X-CONNECTION-NAME=%C4";);
        System.out.println(url3.toString());
        System.out.println(url3.getExtensions());
    }


> Add a way to get the connection config as an URL
> ------------------------------------------------
>
>                 Key: DIRSTUDIO-356
>                 URL: https://issues.apache.org/jira/browse/DIRSTUDIO-356
>             Project: Directory Studio
>          Issue Type: New Feature
>            Reporter: Emmanuel Lecharny
>            Assignee: Stefan Seelmann
>             Fix For: 1.3.0
>
>
> It would be very interesting to be able to get the connection configuration 
> as an URL you can copy and paste so that it makes it easy to share a 
> connection config with omeone else simply by pasting the URL in a 
> mail/IM/whatever.
> For instance, 
> LDAP://<connection-name>@<ldap server 
> host>:<port>/security=TLS?bindDN=uid=admin,ou=system?...(other parameters)
> The URL syntax has to be defined, of course

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to