src.test.java.org.kawanfw.test.util.UsernameConverterTest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aceql-http Show documentation
Show all versions of aceql-http Show documentation
AceQL HTTP is a framework of REST like http APIs that allow to access to remote SQL databases over http from any device that supports http.
AceQL HTTP is provided with three client SDK:
- The AceQL C# Client SDK allows to wrap the HTTP APIs using Microsoft SQL Server like calls in their code, just like they would for a local database.
- The AceQL Java Client JDBC Driver allows to wrap the HTTP APIs using JDBC calls in their code, just like they would for a local database.
- The AceQL Python Client SDK allows SQL calls to be encoded with standard unmodified DB-API 2.0 syntax
package org.kawanfw.test.util;
import org.kawanfw.sql.api.server.util.UsernameConverter;
import org.kawanfw.sql.util.HtmlConverter;
public class UsernameConverterTest {
/**
* @param args
*/
public static void main(String[] args) {
String string = "user-<>:\"/\\|?*";
System.out.println(string);
String specialString = UsernameConverter.fromSpecialChars(string);
System.out.println(specialString);
string = UsernameConverter.toSpecialChars(specialString);
System.out.println(string);
System.out.println();
String ldapUser = "cn=read-only-admin,dc=example,dc=com";
String ldapUserHtml = HtmlConverter.toHtml(ldapUser);
System.out.println(ldapUserHtml);
ldapUser = "CN=L. Eagle,O=Sue\\2C Grabbit and Runn,C=GB";
ldapUser = UsernameConverter.fromSpecialChars(ldapUser);
System.out.println(ldapUser);
ldapUser = HtmlConverter.toHtml(ldapUser);
System.out.println(ldapUser);
}
}