OrientGraphUtils { public static String encodeClassName(String iClassName) { if (iClassName == null) return null; if (Character.isDigit(iClassName.charAt(0))) iClassName = "-" + iClassName; try { return URLEncoder.encode(iClassName, "UTF-8"); } catch (UnsupportedEncodingException e) { return iClassName; } }  static String encodeClassName(String iClassName); static String decodeClassName(String iClassName); static ODirection mapDirection(Direction direction); static final String CONNECTION_OUT; static final String CONNECTION_IN; }
@Test public void encode() { assertThat(encodeClassName(null), nullValue()); assertThat(encodeClassName("01"), equalTo("-01")); assertThat(encodeClassName("my spaced url"), equalTo("my+spaced+url")); assertThat(encodeClassName("UnChAnGeD"), equalTo("UnChAnGeD")); }