JcrStringHelper { public static String idEncode( String id ) { return Text.escapeIllegalJcrChars( id ); } private  JcrStringHelper(); static String fileNameEncode( String fileName ); static String fileNameEncode( String fileName, boolean useMultiByte ); static String idEncode( String id ); static String fileNameDecode( String encodedFileName ); static String fileNameDecode( String encodedFileName, boolean useMultiByte ); static String pathEncode( String path ); static String pathEncode( String path, boolean useMultiByte ); static String pathDecode( String encodedPath ); static String pathDecode( String encodedPath, boolean useMultiByte ); static boolean isMultiByteEncodingEnabled(); static void setMultiByteEncodingEnabled( boolean useMultiByteEncoding ); static boolean isEncoded( String path );  }
@Test public void testLetterDigitIDEncode() { String id = "a243423d-adasdasdasd-asdasd"; String encodedId = JcrStringHelper.idEncode( id ); assertEquals( id, encodedId ); }
@Test public void testDigitLetterIDEncode() { String id = "5a243423d-adasdasdasd-asdasd"; String encodedId = JcrStringHelper.idEncode( id ); assertEquals( id, encodedId ); }